[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

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

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

2003-02-19 Thread Alexander Nasonov
Peter Dimov wrote: The other option is to support a dynamic_cast-style extract: T * p = extractT*(var); T r = extractT(var); but it would likely require partial ordering/specialization. I don't have access to a compiler with broken partial ordering/specialization but I tried to keep it

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

2003-02-19 Thread Peter Dimov
Eric Friedman wrote: Peter Dimov wrote: [...] template class T, ... T extract(variant... operand); template class T, ... T const extract(variant... const operand); template class T, ... T * extract(variant... * operand); template class T, ... T const * extract(variant... const *

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

2003-02-19 Thread Fernando Cacciola
Peter Dimov [EMAIL PROTECTED] wrote in message 00d901c2d820$bd2225c0$1d00a8c0@pdimov2">news:00d901c2d820$bd2225c0$1d00a8c0@pdimov2... David Abrahams wrote: Peter Dimov [EMAIL PROTECTED] writes: Joel de Guzman wrote: David Abrahams wrote: BTW, I just realized that a conversion from

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

2003-02-19 Thread Fernando Cacciola
Suppose you have a variantmpl::listint, std::string AFAICT references are not supported by variant either. But if it were.. How do you check to see if it contains an int? But extracting (or accessing, or peeking) (int)*. Generally speaking, having a way to get a T* which can possibly

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

2003-02-19 Thread David Abrahams
Fernando Cacciola [EMAIL PROTECTED] writes: Peter Dimov [EMAIL PROTECTED] wrote in message 00d901c2d820$bd2225c0$1d00a8c0@pdimov2">news:00d901c2d820$bd2225c0$1d00a8c0@pdimov2... David Abrahams wrote: Peter Dimov [EMAIL PROTECTED] writes: Joel de Guzman wrote: David Abrahams wrote:

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

2003-02-19 Thread David Abrahams
Fernando Cacciola [EMAIL PROTECTED] writes: Suppose you have a variantmpl::listint, std::string AFAICT references are not supported by variant either. But if it were.. How do you check to see if it contains an int? But extracting (or accessing, or peeking) (int)*. Pointers to

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

2003-02-19 Thread Ed Brey
Eric Friedman wrote: The area would be helped by renaming extract to access. I tend to agree the name is confusing. So shall we call it boost::access? Input? Dave A.'s comment that access is confusing because it is a noun and a verb is well taken. Of course, the same can be said for

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

2003-02-19 Thread David Abrahams
Ed Brey [EMAIL PROTECTED] writes: Eric Friedman wrote: The area would be helped by renaming extract to access. I tend to agree the name is confusing. So shall we call it boost::access? Input? Dave A.'s comment that access is confusing because it is a noun and a verb is well taken. Of

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

2003-02-19 Thread Rozental, Gennadiy
Eric Friedman wrote: The area would be helped by renaming extract to access. I tend to agree the name is confusing. So shall we call it boost::access? Input? what about get_value? Gennadiy. ___ Unsubscribe other changes:

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

2003-02-19 Thread Eric Friedman
Ed Brey wrote: [snip] The documentation in reference.html shows that which() returns int. (I didn't check whether the code matched up.) OK, I didn't realize you were talking about the docs. I'll note this to fix. The copyright notice doesn't make clear that the copyright notice need appear

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

2003-02-19 Thread Ed Brey
Eric Friedman wrote: I lifted the copyright notice from other Boost libraries (see MPL and Boost.Threads). I am happy to change the notice if necessary, but should these other libraries follow suit? Yes, they should, and there was another thread out there at one time discussing the details.

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

2003-02-18 Thread David B. Held
Eric Friedman [EMAIL PROTECTED] wrote in message 003c01c2d6f7$2a812c90$49390c80@erk">news:003c01c2d6f7$2a812c90$49390c80@erk... [...] template typename T void operator()(const T operand) const { operand.~T(); } [...] Is the destructor really a const function? Dave

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

2003-02-18 Thread Itay Maman
"David B. Held" wrote: [...] template typename T void operator()(const T operand) const { operand.~T(); } [...] Is the destructor really a const function? Dave The object being destroyed is the formal parameter "operand". The object whose operator() is called is not changed at all, thus

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

2003-02-18 Thread David B. Held
Itay Maman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... David B. Held wrote: [...] template typename T void operator()(const T operand) const { operand.~T(); } [...] Is the destructor really a const function? The object

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

2003-02-18 Thread Eric Friedman
David B. Held wrote: [snip] I realize that the operator ought to be const. But should the reference be? I guess I don't know if you should be able to call a d'tor on a const or not. My understanding is that since the following is legal... const T* p = ...; delete p; ...so is what you

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

2003-02-18 Thread David B. Held
Eric Friedman [EMAIL PROTECTED] wrote in message b2uflv$86s$[EMAIL PROTECTED]">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 non-const reference to avoid confusion. Comeau says it's

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

2003-02-18 Thread Eric Friedman
David Abrahams wrote: [snip] BTW, I just realized that a conversion from variantT to optionalT could be used to do extraction as well. Maybe it would be better to ditch extract altogether and just use optional? I had thought about this before, but I dismissed it (perhaps too quickly) because