Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2003-07-09 15:14:02


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:

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


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