isolating boost variant from the rest of boost

  • Permalink
  • submit to reddit
  • Email
  • Follow


I've written some code that takes advantage of the Boost Variant
library. This code is eventually intended for platforms for which it may
be inappropriate or even impossible to install the entire Boost Library
Suite. Consequently, I might have to come up with a standalone version
of the variant library. Can someone point me at such a library? Or
should I try to tease the variant stuff out of the rest of boost? (The
variant header seems to pull in a large number of other headers.) Or
should I just go ahead and implement my own version?

Much obliged for any advice,

-thant

-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Reply Thant 5/27/2007 1:41:27 PM

See related articles to this posting


Thant Tessman wrote:
> 
> I've written some code that takes advantage of the Boost Variant
> library. This code is eventually intended for platforms for which it may
> be inappropriate or even impossible to install the entire Boost Library
> Suite. Consequently, I might have to come up with a standalone version
> of the variant library. Can someone point me at such a library? Or
> should I try to tease the variant stuff out of the rest of boost? 

Have not tried with variant, but the bcp tool may help.  You find it in
the tools directory of boost.

http://www.boost.org/tools/bcp/bcp.html

> (The
> variant header seems to pull in a large number of other headers.) Or
> should I just go ahead and implement my own version?

The bcp tool will at least reduce your code down to the variant lib and
what variant depend on. Then you can assess if you want to go further
from there.

-- 
regards,
Bj�rn

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Reply ISO 5/27/2007 6:25:12 PM

On 27 Maj, 22:41, Thant Tessman <a...@standarddeviance.com> wrote:
> I've written some code that takes advantage of the Boost Variant
> library. This code is eventually intended for platforms for which it may
> be inappropriate or even impossible to install the entire Boost Library
> Suite. Consequently, I might have to come up with a standalone version
> of the variant library. Can someone point me at such a library? Or
> should I try to tease the variant stuff out of the rest of boost? (The
> variant header seems to pull in a large number of other headers.) Or
> should I just go ahead and implement my own version?

My recommendation would be to give users an option. It would be silly
to build your own version, if that would require users already using
boost to stand on their head in order to avoid ODR-problems etc. I
hope that wont pose to many problems to you.

/Peter


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

0
Reply peter 5/27/2007 6:26:29 PM
comp.lang.c++.moderated 10658 articles. 9 followers. Post

2 Replies
328 Views

Similar Articles

[PageSpeed] 23


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

The boost.variant library and boost::make_recursive_variant
We have this code: typedef boost::make_recursive_variant< int , std::vector< boost::recursive_variant_ > >::type int_tree_t; Use of the resultant variant type is as expected: std::vector< int_tree_t > subresult; subresult.push_back(3); subresult.push_back(5); std::vector< int_tree_t > result; result.push_back(1); result.push_back(subresult); result.push_back(7); int_tree_t var(result); According to documentation in library of boost.variant, a variable var it's ( 1 ( 3 5 ) 7 ). Queastion:Who do it print in language C++ by next of std::cout? Thank...

boost.variant and its efficiency
What do your think about the efficiency of boost.variant on account of a memory and a speed of its action in this boost library. Advice in thanks. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] On Sep 29, 1:25 am, Miroslaw Makowiecki <tyta...@poczta.onet.pl> wrote: > What do your think about the efficiency of boost.variant on account of a > memory and a speed of its action in this boost library. > Advice in thanks. First, boost.variant is move aware, and will try to apply move semant...

Variant proposal, boost::any
I was wondering if there are any existing proposal to integrate a variant type ala boost::any into the standard library? Christopher Diggins http://www.cdiggins.com --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ] <cdiggins@videotron.ca> wrote in message news:1123540817.281676.201160@f14g2000cwb.googlegroups.com... > I...

boost::variant Binary visitation
When i compile this code in VC71 or VC80 i get the following errors: The code is copy/paste from the boost.org tutorial. Please help! error C2039: 'begin' : is not a member of 'boost::variant<T0_,T1>' with [ T0_=int, T1=std::string ] Test2.cpp(47): error C2039: 'end' : is not a member of 'boost::variant<T0_,T1>' with [ T0_=int, T1=std::string ] Test2.cpp(47): error C2039: 'begin' : is not a member of 'boost::variant<T0_,T1>' ...

[C++]boost.variant and its optymalization
How do we think about optymalization boost.variant on account of a memory and a speed of action in its boost library in C++ language. Advice in thanks. miroslaw.makowiecki@gmail.com wrote: > How do we think about optymalization boost.variant on account of a > memory and a speed of action in its boost library in C++ language. > Advice in thanks. *I* don't. Not that I couldn't. I just don't. Why do you ask? Have you found it to be non-optymalized in some way? V -- Please remove capital 'A's when replying by e-mail I do not respond to top-posted replies, plea...

Zombies Boost New Sober Variant
Paul F. Roberts - eWEEKTue Nov 22, 1:23 PM ET Anti-virus and e-mail security companies warned Internet users Tuesday about a new variant of the Sober worm that was flooding e-mail servers around the world, with help from zombie machines infected by earlier editions of the same worm. Sober.AG is the latest in a long line of mass e-mail worms. It appeared Monday, after machines infected with older variants began spamming out the new version in a massive e-mail flood. The e-mail messages use a variety of subterfuges to trick recipients into opening the virus attachment, including...

boost variant template type argument count
I'm using an instance of the boost::variant type as the token value of a non-trivial grammar. The type list is 24 items long. Apparently there is a type list limit of 20 items. Is this correct? Is this just a matter of building the cases, or is it dictated by some platform limit on template type arguments? (Is it actually dictated by the apply_visitor template?) Thanks for any info. (I briefly wandered around the boost headers, but their organization is not transparent to the uninitiated.) -thant -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang....

Design of isolated full bridge boost converter using multiwinding transformer block in simpowersystems blockset
I am facing a problem in designing the isolated full bridge boost converter using the multiwinding transformer block in simulink's simpowersystems blockset. I have used this transformer with a single tap on the upper right side winding and have fixed the duty cycle and step up ratio as per the texts available, however I am not able to get a boost in the output voltage. Can anyone suggest an alternative to the multiwinding transformer block "Smriti" wrote in message <iml8l4$s8d$1@fred.mathworks.com>... > I am facing a problem in designing the isolated full bridge boos...

Any Boost Experts out there for Boost.Regex?
Hello All, I am a newbie to the Boost library and I have a question about a simple function. All I would like to do is to create a simple function that can test strings using regular expressions. I've written this function which appears to work on the first pass and then fails on the second with the following message. Unhandle exeption in Credit Card Example.exe (KERNEL32.DLL) 0x(Some address): Microsoft C++ Exception. My function is as follows.... bool TestStr (std::string szExpr, std::string szSearch) { bool bResult=false; boost::regex *cExpr = new boost::regex(szExpr); bResu...

Boost
Not sure if this is the proper group for this, but I'm wondering if anyone has used Boost (for C++) on the Mac, and has any feedback on how/if it works and under what circumstances. Thanks. In article <2008101213573216807-mac@foobarnetnet>, Mark Casternoff <mac@foobarnet.net> wrote: > Not sure if this is the proper group for this, but I'm wondering if > anyone has used Boost (for C++) on the Mac, and has any feedback on > how/if it works and under what circumstances. > > Thanks. I've used pieces of it, smart pointers for exampl...

boost
Hi everybody. I'm trying to use boost, but just don't know how to set it up. My os is winXP (installed on disk D). Python is installed in D:\Python25 MigGW compiler is installed in D:\MinGW (i downloaded it because djgpp is making much more errors with bjam) I have downloaded boost_1_35_0.zip and boost-jam-3.1.16-1-ntx86.zip, extracted boost_1_35_0.zip to D:\Program Files (so I have now D:\Program Files\boost_1_35_0), extracted there bjam and used bjam in cmd: bjam --build-dir="D:\Program Files\boost_1_35_0" --toolset=gcc stage I got 12 failures and 8 warnings from thi...

boost
Is there a list of all boost libraries? Which ones will be in next C++ std? -- -Gernot int main(int argc, char** argv) {printf ("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);} ________________________________________ Looking for a good game? Do it yourself! GLBasic - you can do www.GLBasic.com "Gernot Frisch" <Me@Privacy.net> wrote in message news:2qqhttF13247kU1@uni-berlin.de... > Is there a list of all boost libraries? Which ones will be in next C++ > std? http://www.boost.org/libs/libraries.htm You shoul...

boost::io_service::post and boost::deadline_time
I am getting boost:asio::error::operation_aborted error codes for an unknown reason in my handlers. No where did a cancel or reset occur, nor was the deadline_time or the io_service destroyed. Does anyone know if I may post to the same io_service a deadline_timer was constructed with or if they will interfere with eachother? May I post multiple times to the deadline timer calling back different methods? I can't imagine why the abort would show up other than I am taking something for granted. ...

boost weak pointers and boost optional
Shouldn't weak_ptr::lock() return a optional<shared_ptr<T> > ? -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] on Sun Jul 13 2008, Thant Tessman <thant.tessman-AT-gmail.com> wrote: > Shouldn't weak_ptr::lock() return a optional<shared_ptr<T> > ? Why should it? -- Dave Abrahams BoostPro Computing http://www.boostpro.com [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] Th...

Boost Problem! Boost.Build not found
Hi! I'm trying to extend my python program with some C++ code. Right now I've spent hours just trying to get boost to work! I'm trying to get the example hello.cpp to work. Using Windows XP and Visual Studio 8 (.NET 2005) I've set BOOST_BUILD_PATH = C:\boost\boost_1_33_1 (where i installed boost) I've changed the jamrules in C:\boost\boost_1_33_1\libs\python\example \tutorial to path-global BOOST_ROOT : C:\boost\boost_1_33_1 ; No matter what I do i always get: C:\boost\boost_1_33_1\libs\python\example\tutorial>bjam -sTOOLS=vc-8_0 Unable to load Boost.Build...

Boost::any and boost::lambda with std::find_if
Hello everybody, How to avoid using struct IsDataType for comparison for find_if algorithm but use something like that what is now commented out in the code below? Regards, Misiu template<typename T> struct IsDataType { bool operator() (const boost::any& operand) { return (operand.type() == typeid(boost::shared_ptr<DataDistributor<T> >)); } }; template<typename T> static DataDistributor<T>* GetDataDistributor() { std::list<boost::any>::iterator iter = std::find_if(m_distrubutors.begin(), m_distrubutors.end()...

boost::bind with boost::fusion::for_each
Hi folks, given: #include <boost/fusion/include/sequence.hpp> #include <boost/fusion/include/algorithm.hpp> #include <boost/fusion/include/vector.hpp> #include <boost/fusion/include/adapt_struct.hpp> #include <boost/lexical_cast.hpp> #include <boost/mpl/eval_if.hpp> #include <boost/mpl/identity.hpp> #include <boost/mpl/next_prior.hpp> #include <boost/fusion/mpl.hpp> #include <boost/fusion/adapted.hpp> #include <boost/array.hpp> #include <boost/fusion/sequence/intrinsic/value_at.hpp> #include <boost...

conversion between Boost.Xpressive and Boost.RegEx
I used Boost.Xpressive after 1.3.4, and found it interesting and helpful, but I suffer from long complie-time. So I wonder there is a way to write the regular expression in Xpressive and use it in Boost.RegEx, since there grammer is simmilar to use Barry wrote: > I used Boost.Xpressive after 1.3.4, and found it interesting and > helpful, but I suffer from long complie-time. So I wonder there is a > way to write the regular expression in Xpressive and use it in > Boost.RegEx, since there grammer is simmilar to use > If you want to use dynamic regexes with xpressive (the stri...

Boost::unordered or boost::intrusive::hashtable
I am looking for a hash-table implementation and have therefore looked at boost. But it seems that its possible to choose some different versions. So far I have found: http://www.boost.org/doc/libs/1_35_0/doc/html/boost/intrusive/hashtable.html http://www.boost.org/doc/libs/1_41_0/doc/html/unordered.html http://www.boost.org/doc/libs/1_41_0/boost/multi_index_container.hpp Which of the above version are best for supporting integer keys and values which ar std::vectors and are there any examples showing how to use the container? ...

Boost..
Ok, i need someone to tell me why to use this library that dont even seem to want to compile 3 out of 5 times :P You have to freeze the version with the release, that should make problems as you make new versions of the program im sure you want to be able to update as much as posible in the maner to just put a new version in and recompile, couse if you have to freeze it it atleast to me says something ... no standard, crappy lib ... But im sure its good in its ways but .. who would want something that forces you to change your code after each upgrade? :/ Thanks for any answers. "Tomas...

boost::thread and boost::asio::io_service questions
I am trying to understand both of these items and how they are executing in our code, so I made a small demo to debug through. 1) Why can't I pass boost::io_service by reference in the call, boost::thread workerThread(DoWork, 1, ioService); with a function signature of void DoWork(const unsigned int threadNum, boost::asio::io_service * ioService) ? I changed it to a pointer and it works, but I don't know why I can't do it by reference. 2) If boost::thread is not copyable, how can I store a collection of "thread handles" or boost::thread objects like the variable workerT...

pass a boost::function as an argument to boost::bind
I want to make a callback that also calls back. I cannot get the code to compile. I read on the boost documentation about apply()., but the example is unclear and I am not sure if that is what I am looking for. /// Smart Pointer typedef boost::shared_ptr<TcpServerSideConnection> SmartPtr; /// Callback function pointer type for TcpListener notification that our execution of /// TcpServerSideConnection::OnConnectionAccepted has completed typedef boost::function<void(TcpServerSideConnection::SmartPtr newConnection, const boost::system::error_code &...

Boost.Threads : is boost::condition thread-safe?
Boost.Threads documentation mentions that boost::mutex::scoped_lock is not thread safe. I didn't find anything on boost::condition though. Is it safe to call my_condition.notify_all() while other threads may be doing something with my_condition too (calling any of its member functions) n.torrey.pines@gmail.com writes: > Boost.Threads documentation mentions that boost::mutex::scoped_lock is > not thread safe. Yes: a scoped lock is used for a single thread to acquire a lock on a mutex. Threads should not touch the scoped_lock objects of other threads. The /Mutex/ is t...

Problems mixing boost::lambda::bind and boost::shared_ptr..
Hi, Consider the following: class A { public: virtual bool foo() = 0; }; class B : public A { public: virtual bool foo() { return false; } }; void fn() { std::list< A * > aList(10); std::list< boost::shared_ptr<A> > aSharedList(10); // This works fine.. std::count_if( aList.begin(), aList.end(), boost::lambda::bind(A::foo, boost::lambda::_1) ); // This doesn't compile.. std::count_if( aSharedList.begin(), aSharedList.end(), boost::lambda::bind(A::foo, boost::lambda::_1) ); } -- Why doesn't the second ...