From 9c554871eba627a75e375d8906db6ee71acdafc8 Mon Sep 17 00:00:00 2001 From: Adrian Burri <burriad@dune-project.org> Date: Tue, 1 Mar 2005 11:39:12 +0000 Subject: [PATCH] Added an Int2Type struct like the one in "Modern C++ Design" [[Imported from SVN: r1583]] --- common/misc.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/misc.hh b/common/misc.hh index f6ae8a63d..d6126c6a1 100644 --- a/common/misc.hh +++ b/common/misc.hh @@ -13,6 +13,14 @@ template <bool flag> class CompileTimeChecker; template <> class CompileTimeChecker<true> { }; +//! Map an integer value to a type +//! This comes in handy if one tries to emulate member function specialization. +//! The idea how to do it is presented in "Modern C++ Design" by Alexandrescu. +template <int N> +struct Int2Type { + enum { value = N }; +}; + namespace Dune { /** @addtogroup Common -- GitLab