|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2006-11-03 16:37:35
FWIW - I'm comfortable with the idea of considering
metaprogaming as similar to C++ macros on steriods. This
fits in well with the term "metaprogramming" - programming
the writing of a program. It also helps your brain from
getting too confused between compile time and runtime
behavior. When on get's used to this then it never occurs for
one to write something like example below.
And once your brain gets comfortable with this,
MPL seems very, very natural.
Robert Ramey
> template <typename X>
> X divide_em(X x, X y)
> {
> if (typeid(x) == typeid(std::string))
> return x;
> else
> return x/y;
> }
>
> std::cout << divide_em<std::string>("one", "two");
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net