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 10647 articles. 9 followers. Post

2 Replies
304 Views

Similar Articles

[PageSpeed] 50


  • 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...

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...

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...

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 &...

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.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...

confused with boost::bind & boost::lambda::bind
I am a new gay to use the library boost, so i confused by some details! now, anybody could help me to explain the difference between boost::bind and boost::lambda::bind when i use the library. I mean when one will work but another don't. they all seem to be a functor,right? thx! -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] { Edits: quoted signature and clc++m banner removed. Please remove manually if your software doesn't. -mod } On May 29, 4:44 pm, XHen...@gmail.com wrote: > I a...

confused by boost::bind & boost::lambda::bind
I am a new gay to use the library boost, so i confused by some details! now, anybody could help me to explain the difference between boost::bind and boost::lambda::bind when i use the library. I mean when one will work but another don't. they all seem to be a functor,right? am i send to the rigjt group? thx! ...

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 ...

Boost Python DLL from Boost Pro is built incorrectly?
I'm having issues with Boost Python, downloaded via http://www.boostpro.com. I *think* it's related to WinXP side by side assemblies. My application that uses Boost Python fails to start. I ran dependancy walker on the Boost Python DLL and I get the following: Error: The Side-by-Side configuration information for "c:\data\excds \test adaptation\BOOST_PYTHON-VC80-MT-1_35.DLL" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001). Error: At least one required implicit...

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>' ...

boost::mem_fn do not always works
Hi friends of boost, in my current program I found a problem, that make me thinking about a missing boost::mem_fn_ref. The code struct Foo { bool IsSomething() const; }; std::vector< Foo > foos; // now I want to check, whether all foos return 'true' // calling IsSomething, so I'm searching for one foo, // which returns 'false'. If I don't find any, all return 'true'! std::find_if( foos.begin(), foos.end(), std::not1( boost::mem_fn( &Foo::IsSomething ) ) ) == foos.end(); this don't compile (MS-Dev 6 SP5, boost 1.30...