boost-variant
boost::variant get last accessed type
This is what I want to do: boost::variant a<int, string>; int b; a=4; b=a; //doesn\'t work. What is the easiest way to make b=4?[详细]
2023-03-28 08:20 分类:问答How to decide on stack vs heap vs boost::pool allocation in a case like this?
I have a class that uses boost::variant to store a double or a string, like this : class value { boost::variant<double, std::string> val;[详细]
2023-03-12 00:54 分类:问答variant problem with compiling a file
I tried compiling the following code from this page: http://www.pdc.kth.se/training/Talks/C++/boost/libs/variant/doc/sample.html[详细]
2023-03-06 08:46 分类:问答using same datatype in boost variant
Can we explicitly typecast the value which is to be 开发者_高级运维stored in boost varaint?? Example:[详细]
2023-03-01 01:00 分类:问答Boost-spirit-karma and boost-variant "concepts" related to auto generators
I need to deserialize a std::vector<boost::variant<..>> with decoration supplied by other objects.[详细]
2023-02-24 11:01 分类:问答google test EXPECT_EQ and boost::make_recursive_variant
I have a boost recursive variant as below.When I开发者_StackOverflow中文版 compare two recursive variant object using assert, it works fine but with EXPECT_EQ, it gives compile error.[详细]
2023-02-20 06:16 分类:问答boost::variant usage
I am developing GUI application via wxWidgets. It has 2 parts: GUI part and \"Logic\" part. I want to have Logic part totally independent on wxWidgets. But one component in the GUI returning wx开发者_[详细]
2023-02-20 02:13 分类:问答Applying a boost::mpl::list to the template parameter of a type
I have a class that requires a boost::variant containing shared pointers to various types as follows:[详细]
2023-01-31 17:49 分类:问答How to compare boost::variant in order to make it a key of std::map?
How to compare boost::variant开发者_开发问答 in order to make it a key of std::map ? Seems that operator<() is not defined for boost::variantEDITED TO FIX ERROR APPLYING BOOST::APPLY_VISITOR[详细]
2023-01-28 15:15 分类:问答C++ template metaprogramming to create a boost::variant from a shared_ptr and a boost::static_visitor
As a personal exercise, I want to implement the visitor pattern using shared_ptr.I am familiar with Robert Martin\'s acyclic visitor paper but find the intrusive nature of the virtual accept() and nec[详细]
2023-01-15 23:50 分类:问答