|
Boost : |
From: Geurt Vos (G.Vos_at_[hidden])
Date: 2001-12-18 03:49:05
>
> Worrying about this name is pretty silly, since it's mostly an
> implementation detail... but "none" is even shorter. I like "none".
>
..none's nice...
"none" should not be considered an implementation detail, though.
In fact, I think it should be clearly documented, because it can
be really useful. For instance, take boost::function. With "none"
it can be implemented something like:
template <
typename Return,
typename Arg1 = mpl::none,
typename Arg2 = mpl::none,
...
>
class function: ... {
typedef typename mpl::list<Arg1,Arg2,...>::type arg_list;
static const int arg_count = mpl::size<arg_list>::result;
};
Passing around arg_list instead of Arg1, Arg2, ... will make
things way cleaner, and the number of arguments used (arg_count)
you will get for free.
Geurt
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk