C:/nobackup/private/physical_svn/trunk/include/physical/detail/dimension_vector.hpp

Go to the documentation of this file.
00001 
00002 /*=============================================================================
00003     physical quantities / units / constants
00004     Copyright (c) 2006, 2007 Martin Schulz
00005     http://physical.sourceforge.net
00006   
00007     This is private code by Martin Schulz.
00008   
00009     Use, modification and distribution is subject to the Boost Software
00010     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
00011     http://www.boost.org/LICENSE_1_0.txt)
00012 =============================================================================*/
00013 
00014 #ifndef PHYSICAL_DIMENSION_VECTOR
00015 #define PHYSICAL_DIMENSION_VECTOR
00016 
00017 #include "physical/detail/zero_vector.hpp"
00018 
00019 #include <boost/mpl/advance.hpp>
00020 #include <boost/mpl/insert.hpp>
00021 
00022 namespace physical {
00023 
00024         namespace detail {
00025 
00026                 /* define a mpl vector of length NUM consisting of a single 1 at position Pos. */
00027 
00028                 template<int POS, int NUM> 
00029                 struct dimension_vector {
00030                         typedef typename zero_vector<NUM-1>::type zvec;
00031                         typedef typename boost::mpl::advance<typename boost::mpl::begin<zvec>::type, boost::mpl::int_<POS> >::type insert_position;
00032                         typedef typename boost::mpl::insert<zvec, insert_position , boost::mpl::integral_c<int,1> >::type dimension_vector_t;
00033                         typedef dimension_vector_t type;
00034                 };
00035 
00036 
00037         }; // namespace detail
00038 
00039 }; // namespace physical
00040 
00041 #endif

Generated on Mon Apr 2 22:25:03 2007 for physical_svn by  doxygen 1.5.1-p1
hosted on SourceForge.net Logo