Boost logo

Boost :

From: Philippe Vaucher (philippe.vaucher_at_[hidden])
Date: 2006-07-18 08:17:43


>
> - is this IMO bad design intentional?
>

Does vector<T>::iterator throw if it goes past .end() ? no.
I think boost simply models after the standard.

What I agree it lack is some kind of .count() so you know how much tokens
there is,
but what you can do to get the info is :

       if(std::distance(tok.begin(), tok.end()) < 3)
       {
               std::cout << "not enough arguments\n";
               exit(1);
       }

       arg1=*pos++;
       arg2=*pos++;
       arg3=*pos++;

Philippe


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