toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Toon-members] TooN/internal builtin_typeof.h


From: Edward Rosten
Subject: [Toon-members] TooN/internal builtin_typeof.h
Date: Tue, 17 Feb 2009 17:16:28 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Edward Rosten <edrosten>        09/02/17 17:16:28

Added files:
        internal       : builtin_typeof.h 

Log message:
        Missing file

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/builtin_typeof.h?cvsroot=toon&rev=1.1

Patches:
Index: builtin_typeof.h
===================================================================
RCS file: builtin_typeof.h
diff -N builtin_typeof.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ builtin_typeof.h    17 Feb 2009 17:16:27 -0000      1.1
@@ -0,0 +1,18 @@
+template<int N> struct Enumerate{char i[N];};
+Enumerate<0> enumerate(const unsigned char&);
+Enumerate<1> enumerate(const char&);
+Enumerate<2> enumerate(const int&);
+Enumerate<3> enumerate(const unsigned int&);
+Enumerate<4> enumerate(const float&);
+Enumerate<5> enumerate(const double&);
+Enumerate<6> enumerate(const std::complex<float>&);
+Enumerate<7> enumerate(const std::complex<double>&);
+template<int N> struct DeEnumerate{};
+template<> struct DeEnumerate<0>{typedef unsigned char type;};
+template<> struct DeEnumerate<1>{typedef char type;};
+template<> struct DeEnumerate<2>{typedef int type;};
+template<> struct DeEnumerate<3>{typedef unsigned int type;};
+template<> struct DeEnumerate<4>{typedef float type;};
+template<> struct DeEnumerate<5>{typedef double type;};
+template<> struct DeEnumerate<6>{typedef std::complex<float> type;};
+template<> struct DeEnumerate<7>{typedef std::complex<double> type;};




reply via email to

[Prev in Thread] Current Thread [Next in Thread]