00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MTL_DIMENSION_INCLUDE
00013 #define MTL_DIMENSION_INCLUDE
00014
00015 namespace mtl { namespace vector {
00016
00017
00018 namespace fixed {
00019
00020 template <std::size_t Size>
00021 struct dimension
00022 {
00023 typedef std::size_t size_type;
00024
00025 static size_type const value= Size;
00026
00027 size_type size() const
00028 {
00029 return value;
00030 }
00031
00032
00033 static bool const is_static= true;
00034 };
00035 }
00036
00037 namespace non_fixed {
00038
00039 struct dimension
00040 {
00041 typedef std::size_t size_type;
00042
00043 static size_type const value= 0;
00044
00045 dimension(size_type v= 0) : my_size(v) {}
00046
00047 size_type size() const
00048 {
00049 return my_size;
00050 }
00051
00052
00053 static bool const is_static= false;
00054 protected:
00055 size_type my_size;
00056 };
00057 }
00058
00059 }}
00060
00061 #endif // MTL_DIMENSION_INCLUDE