Steven Watanabe | 1 Apr 01:48
Picon

Re: mpl::for_each state

AMDG

Skelly, Luke wrote:
> Please ignore my last message.  I somehow accidentally sent it while still editing!
>
> I am trying to create a std::map from an mpl::map.  I've been trying to figure out how to use mpl::for_each to
accomplish this.  The problem I have is that the runtime function is passed to for_each by value and returns
void.  All the examples I've seen for mpl::for_each involve printing and not creating any new objects. 
Here is the attempt I've made:
>
> <snip>
>   
> The problem is in the call to mpl::for_each in the MapMaker constructor.  The std::map is created, but
never returned.  I've considered making func_map static, but that complicates things quite a bit,
especially since MapMaker it is a class template.
>   

Have MapMaker store a reference to map.  (Warning untested code)

typedef std::map<std::size_t, std::size_t> map_type;

struct MapMaker {
    map_type& m;
    template<class T>
    void operator()(T) const {
        func_map[U::first::value]=U::second::value;
    }
};

template<class MplMap>
(Continue reading)

Steven Watanabe | 1 Apr 03:35
Picon

Re: move() aware containers?

AMDG

Noah Roberts wrote:
> I'm reading a pre-release of a book on C++0x threading.  I'm using the 
> boost::thread library since it's supposed to be pretty close.  Now 
> they're using std::vector<> though and I know it's not move ready.
>
> Is there a boost container I can mimic this with?

The containers in Boost.Interprocess support move, but
unless your compiler supports rvalue references, its move
emulation is incompatible with the move emulation
used by Boost.Thread.  Unified move emulation is
a work in progress.

In Christ,
Steven Watanabe
Rodrigo Madera | 1 Apr 04:30
Picon

Re: boost exception tutorial

> I added a Motivation page and a few other tweaks in the documentation.

This is a really good contribution. I've had my own share of
motivation troubles when deciding to modify my in-house exceptions to
be Boostified.

Now that I mention it, is there any interest of the crowd to have
common problems modeled as ready-to-use exceptions?

For example, file not found, access denied, not found (the base for
xxx not found), etc. These would be like  standard building blocks for
new implementations. WDYT?

Regards,
Rodrigo
er | 1 Apr 05:19
Picon

Re: make_argpack(vec_kwd, make_vector(arg[0], ..., arg[n-1]))

Upon reflexion, my problem boils down to finding a metafunction that 
maps an mpl sequence, such as

  typedef mpl::vector<tag1,...,tagn> input;

to the template class boost::parameter::parameters instantiated with
the elements of that sequence, each wrapped with required:

   typedef parameter::parameters<
     required<tag1>,
     ...
     require<tagn>
   > output;

The implementation of parameter::parameters uses a macro so unless I'm 
willing to/can generate input with macro it seems like a dead end. Correct?
Emil Dotchevski | 1 Apr 08:45
Picon

Re: boost exception tutorial

On Tue, Mar 31, 2009 at 7:30 PM, Rodrigo Madera
<rodrigo.madera <at> gmail.com> wrote:
>> I added a Motivation page and a few other tweaks in the documentation.
>
> This is a really good contribution. I've had my own share of
> motivation troubles when deciding to modify my in-house exceptions to
> be Boostified.
>
> Now that I mention it, is there any interest of the crowd to have
> common problems modeled as ready-to-use exceptions?
>
> For example, file not found, access denied, not found (the base for
> xxx not found), etc. These would be like  standard building blocks for
> new implementations. WDYT?

Certainly, if exception types have no members -- which is enabled by
deriving from boost::exception -- there is no need for various
libraries to define their own file_not_found exceptions; a single
boost::exceptions::file_not_found would be sufficient for all use
cases.

As you're suggesting, standardizing exception types with more abstract
semantics, such as a generic "item not found" type also seems logical.
I had the same idea: I do have an item_not_found exception, which is
the base of things like file_not_found, factory_not_found,
type_not_found, etc. But in my own experience -- for what it's worth
-- I've never needed to catch the generic item_not_found type (of
course there's no harm in having that ability.)

Emil Dotchevski
(Continue reading)

Rudolf Leitgeb | 1 Apr 09:21
Favicon

Re: Socket iostream Question

> Diagnosing and reporting failures connecting to servers are  
> problematic.
> Basically, if a connect fails, the only way to know about it is to  
> check the
> fail bit of the iostream. It would be nice to know why a client is  
> unable to
> connect. So, to that end, I thought I could construct the iostream  
> object
> via the default constructor, grab its streambuf via the rdbuf() call  
> and in
> turn grab a basic_socket object reference to the streambuf and then  
> call
> connect() on it, i.e.,

Wouldn't it be easier to extract the fileno from the stream and query
the error with getsockopt ? With this approach you could stay fully
asynchronous yet get the real error code if a connection attempt fails.
Matthieu Brucher | 1 Apr 10:18
Picon

Compiling Boost 1.38.0 with xlc 8.0 (Linux 64)

Hi,

I'm trying to use Boost on a PowerPC with IBM's compiler. Is there a
.jam somewhere to use?

Matthieu
--

-- 
Information System Engineer, Ph.D.
Website: http://matthieu-brucher.developpez.com/
Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn: http://www.linkedin.com/in/matthieubrucher
Stefan Funck | 1 Apr 14:01
Picon

How to build signals2 with bjam?

Hi all,

I just checked out the current release from subversion and tried to build the
signals2 lib with

bjam --toolset=msvc --build-type=complete --with-signals2 stage

but receive the message

error: wrong library name 'signals2' in the --with-≤library> option

Building e.g. the thread or signals lib works fine. Does bjam have a list of
"valid" libraries it checks against and signals2 is not yet contained in, or
what am I doing wrong?

Thanks for any help!
Stefan
Igor R | 1 Apr 14:46
Picon

Re: How to build signals2 with bjam?

> I just checked out the current release from subversion and tried to build the
> signals2 lib with

signals2 is header-only
Frank Mori Hess | 1 Apr 15:11
Favicon
Gravatar

Re: How to build signals2 with bjam?


On Wednesday 01 April 2009, Stefan Funck wrote:
> Hi all,
>
> I just checked out the current release from subversion and tried to build
> the signals2 lib with
>
> bjam --toolset=msvc --build-type=complete --with-signals2 stage

There is no library to build, signals2 is header-only.

Gmane