Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-06-27 16:28:38

Hi Paul,

"Paul A Bristow" <pbristow_at_[hidden]> wrote in message
>I am writing template math functions.
> Some can take integral types (only)
> Some can take real (both built-in floating-point - float, double.. AND User
> Defined real types)
> And some can take either integral OR real.
> Real : Floating-point types
> Integer : Integral types
> Arithmetic : Either Integral OR Floating-point types
> Arithmetic is a bit long - other ideas?
> So to write a function something like
> template <class RealType>
> RealType students_t(ArithmeticType degrees_of_freedom, RealType t)
> { ...
> }
> Using just T is not an option because there are three (at least) possibles.
> What names should I use for the types?

I think they are Concepts rather than types FWIW.

 template <class ArithmeticType ,class RealType>
 RealType students_t(ArithmeticType degrees_of_freedom, RealType t)
{ ...

I assume you meant that above?

> RealType, real_type, RealT, or RT, or ???
> IntType, int_type, IntT, IT, or ???
> ArithmeticType, arithmetic_type, ArithType, arith_type, AT ???
> Suggestions for names please. Rationales? Prior art? Precedents? Standards?
> Thanks

Sounds to me like these Concepts and their requirements need to be written and
put somewhere in the
Boost Docs. . I would be happy to help, but given my
recent form regarding Concepts, I'm probably not the best person to ask! ;-).
Anyway I think they are needed and very useful. Maybe you should start here:

Maybe you could also use type_traits as a basis for names.

Andy Little

Boost list run by bdawes at, gregod at, cpdaniel at, john at