|
Boost : |
Subject: Re: [boost] [xint] Third release is ready, requesting preliminary review
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-05-03 20:54:43
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/03/2010 08:32 PM, Scott McMurray wrote:
>> Possible, yes -- but it relies on a Boost library to do so.
>
> Not in the slightest. You can always use specialization to do it, like:
>
> template <typename T, bool S = std::numeric_limits<T>::is_specialized>
> struct foo { void bar() { ... no min/max ...} };
> template <typename T>
> struct foo<T, true> { void bar() { ... has min/max ...} };
(I assume that's supposed to be std::numeric_limits<T>::is_bounded,
rather than is_specialized.)
Would your average developer know about that sort of thing? I've been
using C++ since 1987, and I'd never seen it until a couple months ago.
And then only by digging into the Boost.TypeTraits library's source code
to figure out how it worked.
- --
Chad Nelson
Oak Circle Software, Inc.
*
*
*
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkvfcFAACgkQp9x9jeZ9/wSkxQCdF+OHqh67IvvDcJs2Kl999q+W
8rMAni9zWwwpWgbRu/Za/B1KMH5o+b4X
=fX+6
-----END PGP SIGNATURE-----
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk