Re: [Boost-users] Reg : Boost Error - any.hpp

Hi,
Below is the snippet code,
class Fcif;
class FcifNode {
public:
FcifNode (const string& val): value (val) {};
FcifNode (const Fcif& fcif): value (fcif) {};
FcifNode (const FcifNode& node): value (node.value) {};
FcifNode& operator= (const string& val)
{ value = val; return *this; };
FcifNode& operator= (const Fcif& val)
{ value = val; return *this; };
FcifNode& operator= (const FcifNode& val)
{ value = val.value; return *this; };
bool isValue () const
{ return (value.type () == typeid (string)); };
bool isFcif () const;
type_info const& type () const { return value.type (); };
string& getValue () const;
Fcif& getFcif () const;
string toString () const;
protected:
any value;
};
class Fcif: public map
Hi,
We are using boost version 1.31.0 in our C++ code. Our OS is HP-UX 11.31 Itanium. We use aCC compiler. While compiling my code, I'm getting the
below
error. Can any one help me to fix this issue ?
"/opt/app/q1app2c4/boost-1.31.0/boost/any.hpp", line 125: error #2070: incomplete type is not allowed ValueType held; ^ detected during: instantiation of class "boost::any::holder<ValueType> [with ValueType=Fcif]" at line 32 instantiation of "boost::any::any(const ValueType &) [with ValueType=Fcif]" at line 35 of "/opt/app/q1app2c4/src/share/incl/Fcif.h"
Cheers, Vijay....(V2K) E-mail to : v2k.sweet_at_[hidden] Catch me @ 9962003328, 7871181610 Blackberry PIN : 259943F3 "Life is just one grand sweet song, so start the music."

On Aug 30, 2011, at 10:37 PM, Vijay
class Fcif;
As someone already pointed out, it's because you're trying to initialize the any with an incomplete type, ie one that has been declared but not defined. Try defining Fcif, or moving the failing constructor to the cpp, and including the definition of Fcif there.
participants (2)
-
Gordon Woodhull
-
Vijay