Boost logo

Boost :

From: Jaakko Jarvi (jajarvi_at_[hidden])
Date: 2003-07-09 15:31:08


In our last exciting episode Howard Hinnant wrote:

> On Wednesday, July 2, 2003, at 06:06 PM, Jaakko Jarvi wrote:

> > libs/utility/test/enable_if*

> Would it be possible to augment the enable_if_constructors.cpp test
> with a templated container? Maybe something like:

Yes it would be possible. Just committed in.

Breaks in g++ 3.2.

ICC 7 accepts.

Metrowerks? Must works, you wouldn't have asked otherwise, right :)

  Jaakko

> template <class charT>
> struct string
> {
> template <class It>
> string(It begin, It end, typename
> enable_if<!is_arithmetic<It>::value>::type* = 0)
> : data(end-begin) {}

> int data;
> };

> #include <assert.h>

> int main (int ,char *[])
> {
> char sa[] = "123456";
> assert(string<char>(sa, sa+6).data == 6);
> }

> Thanks,
> -Howard

> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Regards,
Jaakko Järvi


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk