Trey Jackson wrote:
> >template boost::function1 >DataType> >
> >class work_crew {
> > std::list queue_;
> > FunctionType engine_;
> >public:
> > work_crew(FunctionType const& tocall);
> > void add(DataType d) { queue_.push_front(d); };
> > void dowork()
> > {
> >t
>
>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
_
I've installed boost's threading library following
the build instructions inthe documentation. I was unable to get bjam to
work. No matter what I triedit won't accept my include or library paths for
mingw. However, usingDev-C++, I set up projects using the appropriate
include and librarydire
Jaakko wrote:
>I was doing something like it recently, so, sure:
Awesome!
>template DataType> >
>class work_crew {
> std::list queue_;
> FunctionType engine_;
>public:
> work_crew(FunctionType const& tocall);
> void add(DataType d) { queue_.push_front(d); };
> void dowork
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, _
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 Objec
In article <[EMAIL PROTECTED]>, David Abrahams wrote:
> "Vincent N. Virgilio" <[EMAIL PROTECTED]> writes:
>
>> FYI, xParam (sourceforge) seems to fulfill similar requirements.
>
>
>
> As a matter of nettiquette, please limit the length of quoted text in
> your replies to this list. This one was
"Ken Hagan" <[EMAIL PROTECTED]> wrote in message
b32951$hn8$[EMAIL PROTECTED]">news:b32951$hn8$[EMAIL PROTECTED]...
> 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.rest snipped...
You have po
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 argume
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: te
Peter Dimov wrote:
[snip]
> Destroying a const object is fine, but there is no reason to have a const
in
> the argument.
>
> template 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 detai
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
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 Everet
> > 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
> > 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. He
> > [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
> >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 ;
> -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
> 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
"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
Hello,
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 argument 1 is invali
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
> 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 res
[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 t
> >> > 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
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_m
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 usi
Anthony Williams <[EMAIL PROTECTED]> writes:
> 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 pointe
"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 compil
Ken Hagan wrote:
>
> Alexander Terekhov wrote:
> > Ken Hagan wrote:
> > [...]
> >> 3a If we allow C<&k> [...] 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
> >>
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
Alexander Terekhov wrote:
> Ken Hagan wrote:
> [...]
>> 3a If we allow C<&k> [...] 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
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 = PTHREAD_MUTEX_INITIALIZER;
> >
> > Uhmm. What d
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 me
"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
___
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
| > | te
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 mi
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: http://lists.boost.org/ma
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 globa
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, looki
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
http://aspn.activestate.com/ASPN/Mail/Mes
>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
Ken Hagan wrote:
[...]
> 3a If we allow C<&k> [...] 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 We allow C<&k> a
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 str
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
> dec
"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
"David Abrahams" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> "Fernando Cacciola \(Home\)" <[EMAIL PROTECTED]> writes:
>
> > Hi!
> >
> > I'm under the process of getting rid of some of my old
> > smart pointers replacing them by shared_ptr<>.
> > There is how
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 Tue
"Fernando Cacciola \(Home\)" <[EMAIL PROTECTED]> writes:
> 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 suppor
[Anthony Williams]
> I agree. It would be nice to have a generic RAII framework that went
beyond
> ScopeGuard, and allowed for all the ownership semantics associated with
the
> various forms of smart pointer, whilst permitting the resource itself to
be
> something quite distinct from a pointer.
>
>
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
On Thu, 20 Feb 2003, Peter Dimov wrote:
> 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 initial
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 C
"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-productiv
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.
| > |
|
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
around
> 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 paramete
"Gennadiy Rozental" <[EMAIL PROTECTED]> wrote in message
news:...
> > In that fashion it makes sense. But the only smart_ptr that will
> > make any sense is scoped_ptr. Which will only implement idea #1.
> > As I said my classes offer far more.
>
> Under smart_ptr I
[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 mute
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
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 = ..
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 resp
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 th
"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 dest
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
65 matches
Mail list logo