"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
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
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
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 *
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
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
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:
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
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
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
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:
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
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.
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
"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
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
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
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
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
19 matches
Mail list logo