[boost] padding_of<> proposal

2003-02-10 Thread Philippe A. Bouchard
Hi again, I am doing some helper class that will pad the space after a given type until it reaches a machine word boundary. This word boundary would be the maximum of (alignment_of::value - sizeof(char)) where T is any 'typename', 'typename' is one of {is_class::value == false} and U is any t

[boost] Re: [test] metrowerks linking errors

2003-02-10 Thread Gennadiy Rozental
> If you run bjam with "-d2" option, you'll see all the command lines, which > should be enough to find out which libraries are beeing linked. It appears that I don't really need -d2 to get a linker line. bjam prints ot togerther with error anyway: mwld -search -maxerrors 5 -maxwarnings 20 -expor

[boost] shifted_ptr<> reviewed?

2003-02-10 Thread Philippe A. Bouchard
Hi, I just wanted to know if shifted_ptr.zip is going to be revised for the stable version of Boost. The sandbox looks like a big step ahead; smart_ptr<>s are completely different ;) I am reworking offset.hpp right now. Thanks in advance, Philippe A. Bouchard

Re: [boost] Reflection system in C++ using templates

2003-02-10 Thread David Abrahams
"Lin Xu" <[EMAIL PROTECTED]> writes: >>But you can't do that ;-) >> >>In particular, MemberFun is incompatible with, say, >>MemberFun. You'd need something more like: >> >> MemberFun >> MemberFun >> > Sorry, but why? The two functions have different signitures, a::print > has a void (A::*)(),

Re: [boost] Reflection system in C++ using templates

2003-02-10 Thread Lin Xu
But you can't do that ;-) In particular, MemberFun is incompatible with, say, MemberFun. You'd need something more like: MemberFun MemberFun Sorry, but why? The two functions have different signitures, a::print has a void (A::*)(), while setz has void (A::*)(int)..so they have different

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > I can. On the other hand, I can implement the thread primitives and > optional, too. The point is that if, while building a high-level interface > implementation, we discover an useful low-level primitive that offers > greater expressive power (if less s

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"William E. Kempf" <[EMAIL PROTECTED]> writes: > No, I was asking anyone interested in responding, and you're certainly > not wasting your breath. I think I reached a compromise on these > issues/questions, and would appreciate your response (it's in another > post). Done. >> Allocation can be

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"William E. Kempf" <[EMAIL PROTECTED]> writes: >> From: David Abrahams <[EMAIL PROTECTED]> >> "Peter Dimov" <[EMAIL PROTECTED]> writes: > >> > It's a tool that allows high-level interfaces to be built. Whether >> > people will want/need to build their own high-level interfaces is >> > another stor

[boost] ptr<>::shifted question

2003-02-10 Thread Philippe A. Bouchard
David B. Held wrote: [...] > You might have to pull some tricks with the Ownership policy, I'm not > sure. For conversions, the pointer casts should work, unless you need > to do some tricks. > > Dave As for conversions, I think I will use counted_base, but it seems the new version of shared_co

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread Peter Dimov
William E. Kempf wrote: > > It's not just the efficiencies that concern me with dynamic > allocation. It's the additional points of failure that occur in this > case as well. For instance, check out the article on embedded coding > in the most recent CUJ (sorry, don't have the exact title handy).

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread Peter Dimov
William E. Kempf wrote: > > How about this compromise: > > template > class async_call > { > public: > template > explicit async_call(const F& f) > : m_func(f) > { > } > > void operator()() > { > mutex::scoped_lock lock(m_mutex); > if (m_result) >

RE: [boost] Request for non_copyable.hpp

2003-02-10 Thread Aleksey Gurtovoy
Gustavo Guerra wrote: > On the same spirit, I would like to request that boost::non_copyable > be also moved to a separate header "boost/non_copyable.hpp" or > "boost/utility/non_copyable", so we don't have to include the whole > "boost/utility.hpp" Uhmm, that's actually my fault. I proposed to s

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread Peter Dimov
David Abrahams wrote: > "Peter Dimov" <[EMAIL PROTECTED]> writes: > >> David Abrahams wrote: >>> "Peter Dimov" <[EMAIL PROTECTED]> writes: >>> Unspecified, but I don't think we can avoid that with the low-level interface. High level wrappers that package creation and execution would

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread William E. Kempf
> From: David Abrahams <[EMAIL PROTECTED]> > "William E. Kempf" <[EMAIL PROTECTED]> writes: > >> > I lean towards simple undefined behavior. How do you feel about it? > > I have a feeling that I'm not being asked here, and maybe even that > it's wasted breath because you've grown tired of my emph

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread William E. Kempf
> From: David Abrahams <[EMAIL PROTECTED]> > "Peter Dimov" <[EMAIL PROTECTED]> writes: > > It's a tool that allows high-level interfaces to be built. Whether > > people will want/need to build their own high-level interfaces is > > another story. > > I think it's a valuable question to ask whethe

RE: [boost] Re: binding

2003-02-10 Thread Amélie et François Dumont
In theory we could even have writen: fncSelection = GenAlg::RouletteWheel; but it is the same problem with MSVC6 that with the & form. If anyone has a little time I would be interesting in understanding why MSVC6 doesn't accept that! Thanks -Original Message- From: Greg Dehaas [mailto:

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"William E. Kempf" <[EMAIL PROTECTED]> writes: >> > Sort of... I was thinking about the refactoring where you don't hold >> > the mutex the entire time the function is being called. But even >> > with out the refactoring, there is some room for error: >> > >> > thread1: call() >> > thread2: call(

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > David Abrahams wrote: >> "Peter Dimov" <[EMAIL PROTECTED]> writes: >> >>> Unspecified, but I don't think we can avoid that with the low-level >>> interface. High level wrappers that package creation and execution >>> would be immune to this problem. >> >

[boost] Re: Request for non_copyable.hpp

2003-02-10 Thread Gennaro Prota
On Mon, 10 Feb 2003 17:55:56 -, "Gustavo Guerra" <[EMAIL PROTECTED]> wrote: >Gennaro Prota wrote: >> Well, the title says it all :-) I would like to have a separate source >> file for the ubiquitous BOOST_STATIC_CONSTANT. I have several files >> that use BOOST_STATIC_CONSTANT but no real confi

[boost] Re: Re: Re: shared_ptr with 0 use_count

2003-02-10 Thread dynalink
Thanks again, Peter. That's about what I expected - a mutex around A::create should do the trick. Peter Krnjevic Dynalink Technologies "Peter Dimov" <[EMAIL PROTECTED]> wrote in message 000d01c2d138$2d29e7d0$1d00a8c0@pdimov2">news:000d01c2d138$2d29e7d0$1d00a8c0@pdimov2... > dynalink wrote: > > Wo

Re: [boost] Re: Weak ref. via atomicity (RE: Smart pointers:...)

2003-02-10 Thread Peter Dimov
Alexander Terekhov wrote: [...] > bool acquire_strong_from_weak() { > int status = pthread_refcount_enroll_one(&strong_count); // [...] > Or am I just missing and/or misunderstanding something? You are missing the fact that nobody (even Google) has a clue as to what pthread_refcount_enroll_o

[boost] Re: [Boost.Config] Request for new config macro

2003-02-10 Thread Gennaro Prota
On Mon, 10 Feb 2003 18:18:11 -, "Gustavo Guerra" <[EMAIL PROTECTED]> wrote: >Hi, >I would like to propose the addition of a new config macro to Boost.Config: >BOOST_USING_OLD_STYLE_IOSTREAMS > >A (possibly incomplete) implementation is: >#if defined(__GNUC__) && (__GNUC__ < 3) && !defined(__ST

[boost] Re: Weak ref. via atomicity (RE: Smart pointers:...)

2003-02-10 Thread Alexander Terekhov
Pavel Vasiliev wrote: > > Alexander Terekhov wrote: > > [...] > >> Pavel Vasiliev wrote: > >> > The true locking/unlocking, not InterlockedIncrement/Decrement() > > > > > Nah, pthread_refcount_t. ;-) > > >> > even if availabe,

RE: [boost] Re: io operations for stl containers?

2003-02-10 Thread Paul A. Bristow
I have followed this discussion with great interest. I feel that the lack of an easy, 'library' 'standard' way of 'outputting' STL objects is a major turnoff to their use. There is persistent re-invention of wheels. Some users may have their own special ideas about format, but a default would be

Re: [boost] Re: Re: shared_ptr with 0 use_count

2003-02-10 Thread Peter Dimov
dynalink wrote: > Works great! How thread safe is this? Looks as thread safe as your version, where you could end up calling m_X.reset(new X) simultaneosly if two threads created a B at the same time. IOW, not much. :-) All shared_ptr/weak_ptr operations have the same thread safety level, i.e. mu

[boost] Request for non_copyable.hpp

2003-02-10 Thread Gustavo Guerra
Gennaro Prota wrote: > Well, the title says it all :-) I would like to have a separate source > file for the ubiquitous BOOST_STATIC_CONSTANT. I have several files > that use BOOST_STATIC_CONSTANT but no real config macro. For those > ones, I currently have something like > > #include "boost/config

[boost] [Boost.Config] Request for new config macro

2003-02-10 Thread Gustavo Guerra
Hi, I would like to propose the addition of a new config macro to Boost.Config: BOOST_USING_OLD_STYLE_IOSTREAMS A (possibly incomplete) implementation is: #if defined(__GNUC__) && (__GNUC__ < 3) && !defined(__STL_USE_NEW_IOSTREAMS) || defined(_MSC_VER) && (_MSC_VER < 1300) #define BOOST_USI

[boost] Re: Re: shared_ptr with 0 use_count

2003-02-10 Thread dynalink
Works great! How thread safe is this? Thanks, Peter "Peter Dimov" <[EMAIL PROTECTED]> wrote in message 001301c2d12c$30c1d210$1d00a8c0@pdimov2">news:001301c2d12c$30c1d210$1d00a8c0@pdimov2... > dynalink wrote: > > I need to create a single instance of X and have it disappear when > > the > > final

[boost] Request: BOOST_ENABLE_LONG_LONG

2003-02-10 Thread Gennaro Prota
As I've asked in a recent post, I would like to have boost not using non-standard features (e.g. long long), unless they are explicitly requested by the user. The reason, besides general boost philosophy considerations, is that, with some compilers, it is otherwise impossible to compile code that i

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread Peter Dimov
David Abrahams wrote: > "Peter Dimov" <[EMAIL PROTECTED]> writes: > >> Unspecified, but I don't think we can avoid that with the low-level >> interface. High level wrappers that package creation and execution >> would be immune to this problem. > > Is there really a need for a low-level async_call

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread William E. Kempf
> > From: "Peter Dimov" <[EMAIL PROTECTED]> > Date: 2003/02/10 Mon PM 12:54:28 EST > To: "Boost mailing list" <[EMAIL PROTECTED]> > Subject: Re: Re: [boost] Re: A new boost::thread implementation? > > William E. Kempf wrote: > >> From: "Peter Dimov" <[EMAIL PROTECTED]> > // step 2: exec

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > Unspecified, but I don't think we can avoid that with the low-level > interface. High level wrappers that package creation and execution would be > immune to this problem. Is there really a need for a low-level async_call interface? After all, the exis

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread Peter Dimov
William E. Kempf wrote: >> From: "Peter Dimov" <[EMAIL PROTECTED]> // step 2: execute an async_call call(); >>> >>> This example, and the implementation above, are just complex >>> synchronous calls. I assume you really meant for either the >>> constructor or this call to also ta

Re: [boost] Re: shared_ptr with 0 use_count

2003-02-10 Thread Peter Dimov
dynalink wrote: > I need to create a single instance of X and have it disappear when > the > final B pointer goes out of scope. The problem with this code is that > A::m_X immediately bumps the ref count and only goes out of scope on > termination. > > Here's a simple example: > > class X;

[boost] Re: Live summary of regression tests.

2003-02-10 Thread Markus Schöpflin
Toon Knapen wrote: On Saturday 08 February 2003 00:26, Rene Rivera wrote: If the old run is no longer relevent (as run date October 17 suggests) who would be responsible for removing it? I would think the person who ran the test, or Beman, or David, or any admin, etc. These are results from

[boost] Re: shared_ptr with 0 use_count

2003-02-10 Thread dynalink
I need to create a single instance of X and have it disappear when the final B pointer goes out of scope. The problem with this code is that A::m_X immediately bumps the ref count and only goes out of scope on termination. Here's a simple example: class X;// defined elsewhere; in my case wra

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread William E. Kempf
> From: "Peter Dimov" <[EMAIL PROTECTED]> > >> // step 2: execute an async_call > >> call(); > > > > This example, and the implementation above, are just complex > > synchronous calls. I assume you really meant for either the > > constructor or this call to also take an Executor concept? >

[boost] Request for static_constant.hpp

2003-02-10 Thread Gennaro Prota
Well, the title says it all :-) I would like to have a separate source file for the ubiquitous BOOST_STATIC_CONSTANT. I have several files that use BOOST_STATIC_CONSTANT but no real config macro. For those ones, I currently have something like #include "boost/config.hpp" // for BOOST_STATIC_CONSTA

Re: [boost] Weak ref. via atomicity (RE: Smart pointers:...)

2003-02-10 Thread Peter Dimov
Pavel Vasiliev wrote: > May be the following code answers the challenge? :-). Interesting... [...] > void weak_ref_control_block::release_strong() > { > if(atomic_decrement(&strong_count) == 0) > strong_refs_lost(); > } > bool weak_ref_control_block::acquire_strong_from_weak() > { >

Re: [boost] shared_ptr with 0 use_count

2003-02-10 Thread Peter Dimov
dynalink wrote: > Forgive me if this seems like a really basic question, but how does > one create a shared_ptr with an initial use count of zero? There is no way to create a shared_ptr with use_count of zero. Use_count() returns the number of shared_ptr instances sharing ownership. Use_count() ==

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"William E. Kempf" <[EMAIL PROTECTED]> writes: >> From: David Abrahams <[EMAIL PROTECTED]> Date: 2003/02/10 >> Mon AM 11:15:31 EST To: Boost mailing list <[EMAIL PROTECTED]> >> Subject: Re: [boost] Re: A new boost::thread implementation? >> >> "William E. Kempf" <[EMAIL PROTECTED]> writes: >> >

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread William E. Kempf
> > From: David Abrahams <[EMAIL PROTECTED]> > Date: 2003/02/10 Mon AM 11:15:31 EST > To: Boost mailing list <[EMAIL PROTECTED]> > Subject: Re: [boost] Re: A new boost::thread implementation? > > "William E. Kempf" <[EMAIL PROTECTED]> writes: > > > Actually, there's another minor issue as well.

[boost] Re: io operations for stl containers?

2003-02-10 Thread Jason House
Vladimir Prus wrote: > >>I'm pulling at stings, but there has to be good stuff to add if we come up > > > > with > > > >>the right aspect to develop. I have never heard of a library designed for > >>evaluation of debug-time expressions... It would be interesting to see > > > > how > > > >>powe

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread Peter Dimov
William E. Kempf wrote: >> Here's some compilable code, to put things in perspective: > > Thanks. This helps me, at least. > >> #include >> #include >> #include >> #include >> #include >> #include >> >> template class async_call >> { >> public: >> >> template explicit async_call(F f): f_

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"William E. Kempf" <[EMAIL PROTECTED]> writes: > Actually, there's another minor issue as well. The user can call > operator() and then let the async_call go out of scope with out ever > calling result(). Mayhem would ensue. The two options for dealing > with this are to either block in the des

[boost] shared_ptr with 0 use_count

2003-02-10 Thread dynalink
Forgive me if this seems like a really basic question, but how does one create a shared_ptr with an initial use count of zero? Thanks, Peter ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Re: Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread William E. Kempf
> > From: "Peter Dimov" <[EMAIL PROTECTED]> > Date: 2003/02/10 Mon AM 09:08:08 EST > To: "Boost mailing list" <[EMAIL PROTECTED]> > Subject: Re: [boost] Re: A new boost::thread implementation? > > David Abrahams wrote: > > "Peter Dimov" <[EMAIL PROTECTED]> writes: > > > >> I am not saying that t

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > David Abrahams wrote: >> "Peter Dimov" <[EMAIL PROTECTED]> writes: >> >>> We have three concepts: Runnable, Executor (executes Runnables), and >>> HasResult (for lack of a better name.) The AsyncCall concept I had >>> in mind is both Runnable and HasResu

[boost] Weak ref. via atomicity (RE: Smart pointers:...)

2003-02-10 Thread Pavel Vasiliev
Alexander Terekhov wrote: [...] >> Pavel Vasiliev wrote: >> > The true locking/unlocking, not InterlockedIncrement/Decrement() > > Nah, pthread_refcount_t. ;-) >> > even if availabe, is necessary to support weak references. >>

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread Peter Dimov
David Abrahams wrote: > "Peter Dimov" <[EMAIL PROTECTED]> writes: > >> We have three concepts: Runnable, Executor (executes Runnables), and >> HasResult (for lack of a better name.) The AsyncCall concept I had >> in mind is both Runnable and HasResult, so it can't use operator() >> for both. x.resu

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > David Abrahams wrote: >> "Peter Dimov" <[EMAIL PROTECTED]> writes: >> >>> I am not saying that this is never useful, but syntax should target >>> the typical scenario, not corner cases. >> >> Agreed. I suppose that you'll say it doesn't target the typic

Re: [boost] Re: io operations for stl containers?

2003-02-10 Thread Vladimir Prus
Terje Slettebø wrote: From: "Jason House" <[EMAIL PROTECTED]> Terje Slettebø wrote: Regarding this project. I've got doubts about the viability of it. Well, I'm glad you've given it a greater level of thought. I really like the idea of the composite_format, and probably should try to

Re: [boost] boost_signals.dll contains no symbols

2003-02-10 Thread Douglas Gregor
On Sunday 09 February 2003 08:46 pm, Davlet Panech wrote: > Hello, > > I just compiled build 1.29 with MS Visual C++ 6, and one of the libraries, > boost_signals.dll does not export any symbols (and, as a consequence, no > corresponding .LIB file is generated). Is that normal? A library with no > s

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread Peter Dimov
David Abrahams wrote: > "Peter Dimov" <[EMAIL PROTECTED]> writes: > >> I am not saying that this is never useful, but syntax should target >> the typical scenario, not corner cases. > > Agreed. I suppose that you'll say it doesn't target the typical > scenario because of its confusability. I woul

Re: [boost] Re: Live summary of regression tests.

2003-02-10 Thread Toon Knapen
On Saturday 08 February 2003 00:26, Rene Rivera wrote: > >If the old run is no longer relevent (as run date October 17 suggests) > >who would be responsible for removing it? > > I would think the person who ran the test, or Beman, or David, or any admin, > etc. These are results from compilations

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > David Abrahams wrote: >> "William E. Kempf" <[EMAIL PROTECTED]> writes: >> >>> David Abrahams said: No, my fault. Syntactically, I should've written this: async_call f(create_thread(), bind(g,1,2)); int r = f(); >>> >>> Do yo

Re: [boost] Re: A new boost::thread implementation?

2003-02-10 Thread Peter Dimov
David Abrahams wrote: > "William E. Kempf" <[EMAIL PROTECTED]> writes: > >> David Abrahams said: >>> No, my fault. Syntactically, I should've written this: >>> >>> async_call f(create_thread(), bind(g,1,2)); >>> int r = f(); >> >> Do you want it to be "int r = f();" or just "int r = f;" or

Re: [boost] Re: [test] metrowerks linking errors

2003-02-10 Thread David Abrahams
ehab samir aziz <[EMAIL PROTECTED]> writes: > I am running C++ ver 3 . How can I know exactly the > libraries linked ? You can examine the command lines generated by bjam when it builds your project. > Is a bjam -d2 command that when I issue I discover > libraries linked ? Yes, bjam -d2 will ca

Re: [boost] Re: [test] metrowerks linking errors

2003-02-10 Thread ehab samir aziz
I am running C++ ver 3 . How can I know exactly the libraries linked ? Is a bjam -d2 command that when I issue I discover libraries linked ? --- Vladimir Prus <[EMAIL PROTECTED]> wrote: > Gennadiy Rozental wrote: > >>It looks to me like the C library is not getting > linked into the > >>executable

[boost] Re: [test] metrowerks linking errors

2003-02-10 Thread Vladimir Prus
Gennadiy Rozental wrote: It looks to me like the C library is not getting linked into the executable. There are several possible versions of the C library which might meet the need (some of them listed in the error messages). Can you list the libraries that are being linked in? From that I c