I am having trouble compiling a class header which contains a member field of type sregex
.
The class is defined as :
#include <boost/xpressive/xpressive_fwd.hpp>
namespace Bob
{
class RegexReplace
{
public :
boost::xpressive::sregex m_rx;
std::string m_str;
RegexReplace(const char* strSearch, const char* strReplace);
};
} // namespace Bob
The class cpp file compiles without any problem, but when I include the header into a cpp file which uses the class, the compiler gives the following error :
error: field ‘m_rx’ has incomplete type ‘boost::xpressive::sregex’ {aka ‘boost::xpressive::basic_regex<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >’}
boost::xpressive::sregex m_rx;
What am I doing wrong here ???