# HG changeset patch # User John W. Eaton # Date 1234425839 18000 # Node ID 0f6683a8150a2e586f306abdf3e62998fe137130 # Parent d5af326a3ede175a37518ba14a8e8687bdcd3a5b some comments for lo-traits.h diff -r d5af326a3ede -r 0f6683a8150a liboctave/lo-traits.h --- a/liboctave/lo-traits.h Thu Feb 12 02:49:14 2009 -0500 +++ b/liboctave/lo-traits.h Thu Feb 12 03:03:59 2009 -0500 @@ -23,6 +23,12 @@ #if !defined (octave_liboctave_traits_h) #define octave_liboctave_traits_h 1 +// Ideas for these classes taken from C++ Templates, The Complete +// Guide by David Vandevoorde and Nicolai M. Josuttis, Addison-Wesley +// (2003). + +// Select a type based on the value of a constant expression. + template class if_then_else; @@ -42,6 +48,8 @@ typedef T2 result; }; +// Determine whether a template paramter is a class type. + template class is_class_type { @@ -62,6 +70,9 @@ enum { no = ! yes }; }; +// Define typename ref_param::type as T const& if T is a class +// type. Otherwise, define it to be T. + template class ref_param {