Boost logo

Boost Users :

From: hicks (hicks_at_[hidden])
Date: 2002-05-03 10:20:08


Hi Toon

Thanks for the lead::
http://www.cuj.com/experts/1810/alexandr.htm
I checked it out.

Alex wrote about 3 solutions for the problem
1. Specialize on meber function argument type (e.g., add
IntToType<is_arithmetic<T> > as a parameter type)
2. Create external template helper class with specialization, and call
that from member function.
3. Create internal template helper class.

The article conclused that 1 was usually best. But in the case of an
operator function (operator::*) the number of
arguments are pre-defined, so that is not an immediate option, although
functions to be called from
inside the body of operator*() could be added. As it happens I have
already coded solution 2, so I think I'll
stick with that (also saves clutter inside struture definition). Code
is in last message I posted to this list.

Cheers

Craig Hicks

Toon Knapen wrote:

>On Friday 03 May 2002 13:58, John Maddock wrote:
>
>>>I know how to use type traits to enable compile time seperate procedures,
>>>but not how to use it to define a procedure for some type and not others.
>>>
>
>check out
>http://groups.yahoo.com/group/Boost-Users/message/741
>
>from Aleksey in teaching me how to combine MPL with the type_traits.
>BTW, the article of Andrei really helps (I had read it before but finally
>understood it really trying it muself)
>
>t
>
>
>Info: <http://www.boost.org>
>Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
>Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>

[Non-text portions of this message have been removed]


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