[boost] Re: Patch for dynamic_bitset

2003-02-20 Thread Markus Schöpflin
Gennaro Prota wrote: On Wed, 19 Feb 2003 18:03:22 +0100, Markus Schöpflin [EMAIL PROTECTED] wrote: The main difference is that it casts the NULL to void * and VA6 can deal with that. I just tried. This means that the version on the branch would work with this compiler. Ah! Here's where the

[boost] Re: Formal review of Variant Library (Ed B.)

2003-02-20 Thread Itay Maman
"David B. Held" [EMAIL PROTECTED] wrote in messagenews:b2ug4i$a8q$[EMAIL PROTECTED]... "Eric Friedman" [EMAIL PROTECTED] wrote in message news:b2uflv$86s$[EMAIL PROTECTED]... [...] const T r = ...; r.~T(); Even if my understanding is correct though, it may be best for destroyer to take a

[boost] Re: Thread-Local Storage (TLS) and templates

2003-02-20 Thread Ken Hagan
Reading various replies, we appear to have a couple of things that aren't completely pinned down: the type of k and the implementation of TLS. 1 If k is a regular pointer to integer and TLS is implemented by tweaking page tables for each thread, then k has the same value in each thread and

[boost] No mail

2003-02-20 Thread Anthony Williams
Is there something up with the boost list today? I haven't received anything on the list since yesterday, though a quick check on gmane indicates that there has been activity. Anthony -- Anthony Williams Senior Software Engineer, Beran Instruments Ltd. Remove NOSPAM when replying, for timely

Re: [boost] Re: Formal review of Variant Library (Ed B.)

2003-02-20 Thread Peter Dimov
Itay Maman wrote: David B. Held [EMAIL PROTECTED] wrote in message b2ug4i$a8q$[EMAIL PROTECTED]">news:b2ug4i$a8q$[EMAIL PROTECTED]... Eric Friedman [EMAIL PROTECTED] wrote in message b2uflv$86s$[EMAIL PROTECTED]">news:b2uflv$86s$[EMAIL PROTECTED]... [...] const T r = ...; r.~T(); Even

Re: [boost] Re: Lock Classes: Does anyone care.

2003-02-20 Thread Peter Dimov
Kevin Atkinson wrote: #ifdef FAST_MUTEX_INIT_DESTROY Mutex() : l_(MUTEX_INIT) {} #else Mutex() {pthread_mutex_init(l_, 0);} ~Mutex() {pthread_mutex_destroy($l_);} #endif What makes you think that statically initializing a mutex is faster? It only defers the initialization until

Re: [boost] Re: Lock Classes: Does anyone care.

2003-02-20 Thread Phil Nash
[Alisdair] To use an old English idiom, I think you are putting the cart before the horse [as did Modern C++ Design, IMNSHO] Resource protection is a useful concept, and pointers are simply another resource that needs protecting. It makes little sense to dereference a mutex, for

Re: [boost] Re: Repost: Borland related patches

2003-02-20 Thread John Maddock
Did you try to define BOOST_NO_INCLASS_MEMBER_INITIALIZATION for borland? This will toggle BOOST_STATIC_CONSTANT to use the enum workaround and might fix most of the problems you are having with BCC not allowing static constant members as integral constant expressions in template parameters.

Re: [boost] Re: Re: Thread-Local Storage (TLS) and templates

2003-02-20 Thread Gabriel Dos Reis
David Abrahams [EMAIL PROTECTED] writes: | Gabriel Dos Reis [EMAIL PROTECTED] writes: | | Ken Hagan [EMAIL PROTECTED] writes: | | | Peter Dimov wrote: | | | | k does not exist yet at compile-time (in a pointer to int form), when | | templates are instantiated. | | | | It doesn't have

[boost] Re: Lock Classes: Does anyone care.

2003-02-20 Thread Anthony Williams
Phil Nash [EMAIL PROTECTED] writes: However, I still say that the overriding issue here is simply that of *name*. Smart pointers and resource wrappers are, and still increasingly so, important concepts. Having such a confusing name-intent relationship is, to me, very counter-productive

Re: [boost] No mail

2003-02-20 Thread Beman Dawes
At 05:27 AM 2/20/2003, Anthony Williams wrote: Is there something up with the boost list today? I haven't received anything on the list since yesterday, though a quick check on gmane indicates that there has been activity. Early Tuesday (US Central time) an HP router got into a fight with a

[boost] shared_ptr and null pointer values.

2003-02-20 Thread Fernando Cacciola \(Home\)
Hi! I'm under the process of getting rid of some of my old smart pointers replacing them by shared_ptr. There is however one idiomatic usage that it's pretty hard to locate and edit, so I wondered if shared_ptr could support it. One is initialization from a null pointer value, as in: struct C {

[boost] Re: No mail

2003-02-20 Thread Anthony Williams
Beman Dawes [EMAIL PROTECTED] writes: At 05:27 AM 2/20/2003, Anthony Williams wrote: Is there something up with the boost list today? I haven't received anything on the list since yesterday, though a quick check on gmane indicates that there has been activity. Early Tuesday (US

Re: [boost] shared_ptr and null pointer values.

2003-02-20 Thread Daniel Frey
Fernando Cacciola (Home) wrote: Hi! I'm under the process of getting rid of some of my old smart pointers replacing them by shared_ptr. There is however one idiomatic usage that it's pretty hard to locate and edit, so I wondered if shared_ptr could support it. I don't think it's a good

[boost] Re: Lock Classes: Does anyone care.

2003-02-20 Thread Alexander Terekhov
Peter Dimov wrote: [...] What makes you think that statically initializing a mutex is faster? It only defers the initialization until the first lock call occurs. That's the way how it works under win32. ;-) Plus, pthread_mutex_init gives you the option to test for errors, should you decide

[boost] Re: Lock Classes: Does anyone care.

2003-02-20 Thread Alexander Terekhov
Kevin Atkinson wrote: On Wed, 19 Feb 2003, Alexander Terekhov wrote: struct pthread_mutex_t_ { /* ... */ #ifdef __cplusplus __copy_ctor(const pthread_mutex_t_) { throw Don't do this!; } #endif }; typedef struct pthread_mutex_t_

Re: Re: [boost] Sunpro compilation problems with current main CVS

2003-02-20 Thread Kåsa, Daniel Roy
The problem I am encountering now with the current snapshot is a template relative problem in type_traits/is_based_and_derived.hpp. The compiler asserts; probably because of a template argument matching problem that the preprocessor has. I'm not sure, but I would like to find out how to work

[boost] smart_ptr vs smart_resource

2003-02-20 Thread Phil Nash
Hi all, This is something I have brought up before and it has come up again on the Lock Classes thread and I have made some new comments there, as well as some others touching on the same area: http://aspn.activestate.com/ASPN/Mail/Message/boost/1544269

Re: [boost] Re: Lock Classes: Does anyone care.

2003-02-20 Thread Kevin Atkinson
On Thu, 20 Feb 2003, Alexander Terekhov wrote: I have changed the definition to: #ifdef FAST_MUTEX_INIT_DESTROY ^^^ static const pthread_mutex_t MUTEX_INIT = PTHREAD_MUTEX_INITIALIZER; Uhmm. What does your fast destruction do? Well, looking at the

Re: [boost] Re: Re: Thread-Local Storage (TLS) and templates

2003-02-20 Thread David Abrahams
Gabriel Dos Reis [EMAIL PROTECTED] writes: David Abrahams [EMAIL PROTECTED] writes: | Let me reiterate, just in case somebody missed it: this is a similar | problem to that of using a pointer/reference-to-data-member as a | template paramter. You can think of each thread-local global

[boost] Re: Patch for dynamic_bitset

2003-02-20 Thread Gennaro Prota
On Thu, 20 Feb 2003 09:17:17 +0100, Markus Schöpflin [EMAIL PROTECTED] wrote: PS: I'll write to Jeremy about the merge. Great, thanks. Thanks to *you*! I've informed him now. Genny. ___ Unsubscribe other changes:

[boost] Re: Boost.Conversion: possible problem with gcc3

2003-02-20 Thread Gennaro Prota
On Wed, 19 Feb 2003 18:51:42 -0500, Davlet Panech [EMAIL PROTECTED] wrote: Hello, I'm getting the following warning in gcc 3.2/CYGWIN/boost 1.29: % /cygdrive/c/boost/boost_1_29_0/boost/cast.hpp:178: warning: decimal constant is so large that it is unsigned 173: static long long min() 174: {

Re: [boost] Re: Re: Thread-Local Storage (TLS) and templates

2003-02-20 Thread Gabriel Dos Reis
David Abrahams [EMAIL PROTECTED] writes: | Gabriel Dos Reis [EMAIL PROTECTED] writes: | | David Abrahams [EMAIL PROTECTED] writes: | | | Let me reiterate, just in case somebody missed it: this is a similar | | problem to that of using a pointer/reference-to-data-member as a | | template

Re: [boost] smart_ptr vs smart_resource

2003-02-20 Thread David Abrahams
Phil Nash [EMAIL PROTECTED] writes: Pointers are Resources Resources are not (all) Pointers. Actually, Pointers *refer to* resources Not all pointers refer to (are) resources -- Dave Abrahams Boost Consulting www.boost-consulting.com

Re: [boost] Re: Re: Thread-Local Storage (TLS) and templates

2003-02-20 Thread David Abrahams
Gabriel Dos Reis [EMAIL PROTECTED] writes: David Abrahams [EMAIL PROTECTED] writes: | Gabriel Dos Reis [EMAIL PROTECTED] writes: | | However, my point is that | |* a class is closed: that is, by the time you put the closing brace, | the offset of the data member is a

[boost] Re: Thread-Local Storage (TLS) and templates

2003-02-20 Thread Ken Hagan
Alexander Terekhov wrote: Ken Hagan wrote: [...] 3a If we allow Ck [...] It is then possible to initialise static variables [...] and the results depend on the thread that ran first. Again, we have the same problem passing a pointer to a function, so I'm not bothered by this. 3b

[boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Anthony Williams
David Abrahams [EMAIL PROTECTED] writes: Phil Nash [EMAIL PROTECTED] writes: Pointers are Resources Resources are not (all) Pointers. Actually, Pointers *refer to* resources Not all pointers refer to (are) resources How about: Pointers are a way of

[boost] Re: Thread-Local Storage (TLS) and templates

2003-02-20 Thread Alexander Terekhov
Ken Hagan wrote: Alexander Terekhov wrote: Ken Hagan wrote: [...] 3a If we allow Ck [...] It is then possible to initialise static variables [...] and the results depend on the thread that ran first. Again, we have the same problem passing a pointer to a function, so I'm

Re: [boost] Re: Thread-Local Storage (TLS) and templates

2003-02-20 Thread David Abrahams
Ken Hagan [EMAIL PROTECTED] writes: Reading various replies, we appear to have a couple of things that aren't completely pinned down: the type of k and the implementation of TLS. I think you may be missing the point that in some sense k doesn't have to have a single type. At compile-time it

Re: [boost] smart_ptr vs smart_resource

2003-02-20 Thread Sam Partington
David Abrahams wrote: Phil Nash [EMAIL PROTECTED] writes: Pointers are Resources Resources are not (all) Pointers. Actually, Pointers *refer to* resources Not all pointers refer to (are) resources I like word games: Not all resources are referred to using pointers.

Re: [boost] Re: Lock Classes: Does anyone care.

2003-02-20 Thread Kevin Atkinson
On Thu, 20 Feb 2003, Alexander Terekhov wrote: Kevin Atkinson wrote: On Thu, 20 Feb 2003, Alexander Terekhov wrote: I have changed the definition to: #ifdef FAST_MUTEX_INIT_DESTROY ^^^ static const pthread_mutex_t MUTEX_INIT =

Re: [boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Phil Nash
Pointers are Resources Resources are not (all) Pointers. Actually, Pointers *refer to* resources Not all pointers refer to (are) resources How about: Pointers are a way of referring to resources. Not all ways of referring to resources

Re: [boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Phil Nash
[Anthony Williams] On Windows, for example, you can use GlobalAlloc to allocate some memory, and you get an HGLOBAL back --- a handle to the memory. You need to call GlobalLock with that handle to get a pointer to the memory which you can actually use. The resource manager therefore needs to

Re: [boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Alan Bellingham
Phil Nash: Not all pointers refer to resources. Hmmm, unless you are thinking of null pointers I can't think of any pointers that don't refer to resources. Perhaps we have a different definition of resource? Or of 'refer to resources'? char * ptr = new char [12]; // points to

RE: [boost] smart_ptr vs smart_resource

2003-02-20 Thread Rozental, Gennadiy
Well the problem I see is that we are using an entity with pointer written all over it (the name especially, but also the primary semantics). Surely managing general resources according to RAII principles is a more general concept than managing pointers to objects? At the very least

RE: [boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Rozental, Gennadiy
-Original Message- From: Phil Nash [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 1:13 PM To: Boost mailing list Subject: Re: [boost] Re: smart_ptr vs smart_resource [Anthony Williams] On Windows, for example, you can use GlobalAlloc to allocate some memory,

Re: [boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Phil Nash
Hmmm, unless you are thinking of null pointers I can't think of any pointers that don't refer to resources. Perhaps we have a different definition of resource? Or of 'refer to resources'? char * ptr = new char [12]; // points to (ergo, refers to) resource char * ptr2 = ptr+4 ; //

Re: [boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Phil Nash
[Anthony Williams] On Windows, for example, you can use GlobalAlloc to allocate some memory, and you get an HGLOBAL back --- a handle to the memory. [..] This sounds like a perfect case where using a smart_PTR would be very confusing, maybe dangerously so! [Gennadiy] The only

Re: [boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Phil Nash
Hmmm, unless you are thinking of null pointers I can't think of any pointers that don't refer to resources. Perhaps we have a different definition of resource? Could you elaborate? I think of resources as things which can be separately managed independent of other objects. Here are

RE: [boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Rozental, Gennadiy
The only place where you will see usage of the name smart_ptr is somewhere deep in library code: typedef smart_ptr ... GlobalMemoryHandler; After that you will use non-confusing name GlobalMemoryHandler. It may work out that way in this case - but why not make the name

RE: [boost] Re: binding

2003-02-20 Thread Amélie et François Dumont
Yet an other remark but this time about the answer of Graig Henderson to Greg Dehass: Greg, From the Linker Error, it looks like you're using Microsoft Visual C++. I discovered a bug recently with MSVC7.0 which may be the same as you're seeing here, but it is reported to be fixed in Everett. The

[boost] Re: smart_ptr vs smart_resource

2003-02-20 Thread Jason House
Well, being relatively a newbie at all this stuff, I have to admit that the initial discussion of performing a lock using a (smart) pointer, seemed odd to me. Someone later clarified that a smart pointer doesn't need to use * and - operators... something very non-pointer-like to me... * The

[boost] Re: Re: Formal review of Variant Library (Ed B.)

2003-02-20 Thread Eric Friedman
Peter Dimov wrote: [snip] Destroying a const object is fine, but there is no reason to have a const in the argument. templateclass T void call_destructor(T t) { t.~T(); } X const x; f(x); // OK, T = X const f(5); // compile-time fail Good point. Even though the class is in the detail

[boost] Re: [variant] Problems compiling Variant under gcc 3.2

2003-02-20 Thread Eric Friedman
Ronald Garcia wrote: I am attempting to use GCC 3.2 to review the variant library, but I am getting compile-time errors: boost/variant.hpp:569: no class template named `mpl' in `boost::detail::variant ' boost/variant.hpp:569: parse error before `,' token boost/variant.hpp:569: template

[boost] boost::bind question

2003-02-20 Thread Trey Jackson
All, Using boost 1_29_0, Linux gcc3.2.1. Just started using boost::bind, like it a lot. I'm playing around with a little work crew, which just queues up data, then calls the function on them later. bind does a great job of packaging up functions for later use. is there an analogue for the

[boost] Re: Preliminary submission: command line config file library

2003-02-20 Thread Vincent N. Virgilio
In article [EMAIL PROTECTED], Vladimir Prus wrote: Vincent N. Virgilio wrote: FYI, xParam (sourceforge) seems to fulfill similar requirements. I had a brief look at the project before, and looked for another time now. Are you sure that project called XParam - General-Purpose Object

RE: [boost] boost::bind question

2003-02-20 Thread Aleksey Gurtovoy
Trey Jackson wrote: Just started using boost::bind, like it a lot. I'm playing around with a little work crew, which just queues up data, then calls the function on them later. [...] I'd like to be able to do something like: , | work_crew??? mycrew(bind(X::f, x, _1, _2));

Re: [boost] boost::bind question

2003-02-20 Thread Trey Jackson
Jaakko wrote: [snip] Apologies, I cut/paste the wrong name. Aleksey Gurtovoy wrote the text I quoted. -- Trey Jackson [EMAIL PROTECTED] This man is depriving a village somewhere of an idiot. -- filed in an officer fitness report in the British Royal Navy

RE: [boost] boost::bind question

2003-02-20 Thread Aleksey Gurtovoy
Trey Jackson wrote: template class DataType, class FunctionType = boost::function1void, DataType class work_crew { std::listDataType queue_; FunctionType engine_; public: work_crew(FunctionType const tocall); void add(DataType d) { queue_.push_front(d); };