Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::variant compile error
From: Georg.Kellerer_at_[hidden]
Date: 2012-11-13 01:33:44


Hi Jeffrey,

thanks for your help. The fexport keyword was to decide if i build a dll or another application that is using my class. I removed it since my module will compile to a static library and until now all works fine.

greetings,
Georg

________________________________
Von: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] Im Auftrag von Jeffrey Lee Hellrung, Jr.
Gesendet: Freitag, 9. November 2012 15:13
An: boost-users_at_[hidden]
Betreff: Re: [Boost-users] boost::variant compile error

On Thu, Nov 8, 2012 at 11:44 PM, <Georg.Kellerer_at_[hidden]<mailto:Georg.Kellerer_at_[hidden]>> wrote:
Hi,

i'd like to build a heterogenous container based on the boost::variant datastructure. My code looks like this:
// forward-Deklarationen:
class fExport FB_Ordered;
class fExport FB_Dictionary;

What's fExport?

// Typedefs
typedef boost::variant<int, std::string> keydicttype;
typedef boost::variant<
        int, std::string, date, ptime,
        boost::recursive_wrapper<FB_Dictionary>,
        boost::recursive_wrapper<FB_Ordered>> valuedicttype;
typedef boost::container::map<keydicttype, valuedicttype> basedict;

C:\dev\boost_1_52_0\boost/checked_delete.hpp(32) : error C2027: use of undefined Type "FB_Ordered"

what i want to do is to create a container fb_dictionary which can hold datatypes that are listed in the valuedicttype and which can accept keyvalues of int and string (see above). fb_ordered is another container defined in a diferent header file so i need the forward declarations. Could anybody please give me a hint in the right direction? I am using vs2008.

A full, expected-to-compile example is always helpful. But the errors I'm getting with the above typedefs seem more related to the lack of this fExport keyword you're using. If I remove the fExport stuff then all the typedefs compile fine, and I don't get the undefined type error until I try to instantiate basedict (obviously; FB_Ordered and FB_Dictionary need to be defined by then).

- Jeff



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net