This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] libstdc++/21244
Paolo Carlini <pcarlini@suse.de> writes:
| Gabriel Dos Reis wrote:
|
| >Or, I see what you mean. Even is you make the enumeration named,
| >you still run the risk of having unspeakble quantum process peaks
| >overload and render the whole incomprehensible.
| >
| ;) Funny, these days I'm reading something related to Bell's theorem
| (Tim Maudlin's book "Quantum Non-Locality and Relativity)
|
| > What is need is this
| >
| > template<class _Sp, class _Tp>
| > struct __traitor
| > {
| > enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
| > typedef typename __truth_type<__value>::__type __type;
| > };
| >
| >Note the bool(...) -- please don't put static_cast, the conversion is
| >safe. And maybe put a comment at the start of the files, or in the
| >docs (somewhere).
| >
| >
| Ok, thanks for the nice solution. Elsewhere actually naming the enums
| seems preferable, since the values are involved in complicated arithmetic...
Naming the enumeration is not the cure. See my other message --
you're at the mecry of an overload (which is the key issue, actually).
-- Gaby