Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2003-07-09 11:44:49


Jaakko,

There are three issues I have with enable_if as it is.

1. enable_if takes a boolean template argument. I would like to see it
taking a type with a member value that that can be used in an ICE. This
would play nice with mpl and type_traits and would make enable_if
expressions shorter.

template <class T>
typename enable_if<boost::is_arithmetic<T>, void>::type foo(T t) {
   std::cout << "An arithmetic type\n";
}

2. I am unhappy about the name enable_if_lazy. First it reads as a
condition, whereas being lazy is not the condition. Second it is
inconsistent with the mpl apply_if. At least the inconsistency should be
fixed IMO.

3. To me the disable templates don't add any value. They are just
duplicating the amount of code without any real benefit. I know this is
a matter of taste, it's just that I would prefer a minimal interface.

Thomas

-- 
Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet 
Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
http://www.ive.uni-hannover.de

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