Gabriel Redner | 9 Feb 23:49
Picon

[fusion] Use of FUSION_MAX_VECTOR_SIZE in headers

Hi all,

I'm trying to use fusion vectors with more than 10 elements, but I'm
running into some trouble.

I'm using fusion as an implementation detail of some header-based
tools, which get included (often indirectly) by some translation
units.  The tools require large fusion vectors, but I don't want
client code (i.e. the .cpp files) to have to care about this.  I was
under the impression that I could just add:

#define FUSION_MAX_VECTOR_SIZE 20
#include <boost/fusion/container.hpp>

in my tool's header file, and be off to the races.  It seems that this
works only if no other fusion header has been included previously in
the same translation unit:

#include <boost/fusion/container.hpp>
...
#define FUSION_MAX_VECTOR_SIZE 20
#include <boost/fusion/container.hpp>
...
// Error - too many template arguments!
boost::fusion::make_vector(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);

I really don't want to have to track down every translation unit which
is (usually indirectly) including my tool's header.  I am under the
impression that boost::function is fine with client code redefining
its limit macro and re-including its header, but perhaps fusion does
not have the same feature?

I also realize that for vector itself I can just include vectorN.hpp
and use vectorN<...>, but if I want to use the generation functions
(make_vector, vector_tie) it seems I'm stuck.  Is there a workaround,
or just something obvious that I'm doing wrong?

Thanks,
-Gabe
Kumar, Akhilesh | 9 Feb 20:37
Picon

Reading response without blocking

Hi,

 

I am using boost ASIO for uploading file to a http server(I had everything working using WinInet but switching to boost::ASIO for portability reason.). I have upload working but at the end of upload I want to read the response from the server, but I am not sure how to find that there is not more data on the wire.

 

I am using sync socket, so my call are blocking if there is no more data, here is what I need to know.

How do I make sure that my call does not block if there is no more data?

Or how do I know that there is no more data on the wire so don’t try to read it?

IS there any call which simply check and return if there is no more data?

 

Can I use async read even though I am using sync socket for everything else. I don’t’ want to switch to async socket unless there is now way out of it.

 

As sample code will be welcome

 

Thanks,

Akhilesh

 

_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hicham Mouline | 9 Feb 21:59

PP: transform BOOST_PP_SEQ_FOR_EACH(macro, data, seq) to vertical repetition

Hi,

 

For a given result of

   BOOST_PP_SEQ_FOR_EACH(macro,data,seq)

 

It is possible to obtain the same result, but in vertical repetition instead, with:

 

#define BOOST_PP_LOCAL_MACRO(n) macro(_,data, BOOST_PP_SEQ_ELEM(n, seq))

#define BOOST_PP_LOCAL_LIMITS (0,BOOST_PP_DEC( BOOST_PP_SEQ_SIZE(seq)))

#include BOOST_PP_LOCAL_ITERATE()

 

I can’t see the way to implement a new macro called

  BOOST_PP_SEQ_FOR_EACH_VERTICAL(macro,data,seq)

 

Regards,

_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
joel falcou | 9 Feb 22:04
Picon
Gravatar

Re: PP: transform BOOST_PP_SEQ_FOR_EACH(macro, data, seq) to vertical repetition


Hicham Mouline wrote: > > I can’t see the way to implement a new macro called > > BOOST_PP_SEQ_FOR_EACH_VERTICAL(macro,data,seq) >
You can't have #define or # incldue INSIDE another macro -- -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35
Benedetto Proietti | 9 Feb 04:54
Picon

Re: [fusion] problems with accumulate metafunction

Greetings.
 
I am kind of newbie to Boost.Fusion.
 
I have a sequence of "Field"s:
 
typedef fusion::vector<
    Field<int, 3, Check1, ..>,
    Field<float, 8, Check2, ..>,
    Field<MyString, 2, Check3, ..>,
    ...
>  MySequence;
 
Each "Field" knows how to (de)serialize, has some checking policy and a few more little stuff.
"Field" also has a "int" property "TypeSize":
 
static const int TypeSize = somevalue_known_at_compile_time;
 
 
I'd like to traverse the type "MySequence" and get the sum of all the sizes at compile time.
Like:  
Field<int,3,Check1>::TypeSize + Field<float, 8, Check2>::TypeSize + Field<MyString,2,Check3>::TypeSize + ... ;
 
I tried playing with fusion::accumulate and mpl<int_> but couldn't do it.
There's no much documentation/examples about fusion (correct me if I am wrong please).
How can I get the accumulated sum of Field<...>::TypeSize of all the members in "MySequence"? 

Thanks in advance,
  Benedetto
 

PS: It's not really a priority (the cost of doing that at runtime once for object is minimal), but I'd really like to fully understand Fusion, which I have found very useful so far.
 
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Tim.Olmer | 9 Feb 10:12
Picon

Compile problems Boost for CE (with STLport)

Hi all,

 

I have some problems compiling Boost for Windows CE (with STLport).

 

I get the following compile error when I try to build the signals library:

 

...updating 16 targets...

compile-c-c++ bin.v2\libs\signals\build\msvc-9.0~wm5~stlport\release\link-static\stdlib-stlport\threading-multi\trackable.obj

trackable.cpp

C:\Program Files\Windows CE Tools\wce600\TestDCOM\include\ARMV4I\../Armv4i/new(59) : error C2375: 'operator new' : redefinition; different linkage

        predefined C++ types (compiler internal)(23) : see declaration of 'operator new'

C:\Program Files\Windows CE Tools\wce600\TestDCOM\include\ARMV4I\../Armv4i/new(65) : error C2375: 'operator delete' : redefinition; different linkage

        predefined C++ types (compiler internal)(24) : see declaration of 'operator delete'

C:\build\STLport\stlport-mainline\stlport\stl/_new.h(134) : error C2264: 'operator new' : error in function definition or declaration; function not called

C:\build\STLport\stlport-mainline\stlport\stl/_new.h(135) : error C2264: 'operator delete' : error in function definition or declaration; function not called

libs\signals\src\trackable.cpp(30) : error C2264: 'operator delete' : error in function definition or declaration; function not called

libs\signals\src\trackable.cpp(45) : error C2264: 'operator new' : error in function definition or declaration; function not called

 

 

Does anyone have an idea what I am doing wrong?

 

Bjam commando: "bjam.exe" --prefix=c:\build\out --with-signals define=_HAS_ITERATOR_DEBUGGING=0 define=_SECURE_SCL=0 link=static runtime-link=static,shared --toolset=msvc-9.0~wm5~stlport stdlib=stlport install

 

 

Thanks a lot!

 

Tim

 

 

P.S. I have attached the user-config and vcvars files.


______________________________________________________________________
Priva B.V.

A disclaimer is applicable to this email, please refer to www.priva.nl/disclaimer.

Op deze email is een disclaimer van toepassing, ga naar www.priva.nl/disclaimer.
Attachment (wm5-vcvars32.bat): application/octet-stream, 2135 bytes
Attachment (user-config.jam): application/octet-stream, 4034 bytes
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Radha | 9 Feb 12:18
Picon

xlc boost without bzip2 support - Unresolved symbols

Hi Team,

I built boost 1.40 iostream lib with xlc 6.0:
setenv NO_BZIP2 1
setenv NO_ZLIB 1
bjam -d+2 --prefix= .... boost/aix64 --with-thread toolset=vacpp cflags="-q64 " cxxflags="-q64" link=shared linkflags="-q64" threading=multi --with-iostreams --layout=versioned install

Even when I attempt to build without bzip2 support, why am I getting unresolved symbols at run time of executable linked? Am i missing something here?

rtld: 0712-001 Symbol BZ2_bzCompressEnd was referenced
      from module ....stage-O/lib/aix64/libboost_iostreams-xlc-mt-1_40.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol BZ2_bzDecompressEnd was referenced
      from module ....stage-O/lib/aix64/libboost_iostreams-xlc-mt-1_40.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol BZ2_bzCompress was referenced
      from module .... aix64/libboost_iostreams-xlc-mt-1_40.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol BZ2_bzDecompress ....stage-O/lib/aix64/libboost_iostreams-xlc-mt-1_40.so was referenced
      from module ...stage-O/lib/aix64/libboost_iostreams-xlc-mt-1_40.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol BZ2_bzCompressInit was referenced
      from module ..stage-O/lib/aix64/libboost_iostreams-xlc-mt-1_40.so(), but a runtime definition
      of the symbol was not found.

Thanks in advance,
Radha

_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Mikko Vainio | 9 Feb 12:53
Picon
Favicon

Re: xlc boost without bzip2 support - Unresolved symbols


Radha wrote: > Hi Team, > > I built boost 1.40 iostream lib with xlc 6.0: > setenv NO_BZIP2 1 > setenv NO_ZLIB 1 > bjam -d+2 --prefix= .... boost/aix64 --with-thread toolset=vacpp > cflags="-q64 " cxxflags="-q64" link=shared linkflags="-q64" > threading=multi --with-iostreams --layout=versioned install > > Even when I attempt to build without bzip2 support, why am I getting > unresolved symbols at run time of executable linked? Am i missing > something here?
Please try bjam -s"NO_BZIP2=1" -s"NO_ZLIB=1" ... The "variables" referred in the iostreams documentation are Boost.Build variables, not environment variables. The latest docs do state this, but still give no example how to set the variables on command line. Cheers, Mikko
Lloyd | 9 Feb 09:30
Picon

tokenize string delimiter

Hi,
  Is it possibleto tokenize a string based on a string delimiter?
 
Thanks,
   Lloyd

______________________________________ Scanned and protected by Email scanner
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Picon

Re: tokenize string delimiter

yes, see the string algorithms library

On Tue, Feb 9, 2010 at 4:30 PM, Lloyd <lloyd <at> cdactvm.in> wrote:

> Hi, >   Is it possibleto tokenize a string based on a string delimiter? > > Thanks, >    Lloyd > > ______________________________________ > Scanned and protected by Email scanner > > > _______________________________________________ > Boost-users mailing list > Boost-users <at> lists.boost.org > http://lists.boost.org/mailman/listinfo.cgi/boost-users >
_______________________________________________ Boost-users mailing list Boost-users <at> lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Alan M. Carroll | 9 Feb 01:19
Favicon

lexical_cast specializations

I did some searching but did not find anything that directly addresses
my issue.

I  have  been  working  with  the  QT library and I wanted to optimize
boost::lexical_cast for QString. My goal is to have the speed of
direct  conversions (as QString provides specialized methods for char*
and  std::string)  while keeping the convenience of using lexical_cast
by reflex. My results (which seem to work) look like this:

namespace boost {
    template <> inline QString lexical_cast<QString, char const *>(char const * const& src) {
        return src ? QString(src) : QString();
    }
    template <> inline QString lexical_cast<QString, char *>(char * const& src) {
        return src ? QString(src) : QString();
    }
}

Is this an appropriate / recommended approach? If not, is there a
better one? There are some other cases of a similar nature that I
would like to optimize as well.

Gmane