Mercurial > hg > octave-nkf
diff liboctave/lo-traits.h @ 9685:e793865ede63
implement builtin_type
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 02 Oct 2009 08:27:44 +0200 |
parents | 0f6683a8150a |
children | 192d94cff6c1 |
line wrap: on
line diff
--- a/liboctave/lo-traits.h +++ b/liboctave/lo-traits.h @@ -81,6 +81,23 @@ typedef typename if_then_else<is_class_type<T>::no, T, T const&>::result type; }; +// Will turn TemplatedClass<T> to T, leave T otherwise. +// Useful for stripping wrapper classes, like octave_int. + +template<template<typename> class TemplatedClass, typename T> +class strip_template_param +{ +public: + typedef T type; +}; + +template<template<typename> class TemplatedClass, typename T> +class strip_template_param<TemplatedClass, TemplatedClass<T> > +{ +public: + typedef T type; +}; + #endif /*