C:/nobackup/private/physical_svn/trunk/include/physical/detail/zero_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_ZERO_VECTOR
00015 #define PHYSICAL_ZERO_VECTOR
00016 
00017 #include <boost/mpl/vector_c.hpp>
00018 #include <boost/mpl/push_back.hpp>
00019 
00020 
00021 namespace physical {
00022 
00023         namespace detail {
00024 
00025                 /* define a mpl vector consisting of N zeros */
00026 
00027                 template<int N>
00028                 struct zero_vector;
00029 
00030                 template<int N>
00031                 struct zero_vector {
00032                         typedef typename boost::mpl::push_back<typename zero_vector<N-1>::type, boost::mpl::integral_c<int,0> >::type type;
00033                 };
00034 
00035                 template<>
00036                 struct zero_vector<1> {
00037                         typedef boost::mpl::vector_c<int,0> type;
00038                 };
00039 
00040         }; // namespace detail
00041 
00042 }; // namespace physical
00043 
00044 #endif

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