00001 // Software License for MTL 00002 // 00003 // Copyright (c) 2007 The Trustees of Indiana University. 00004 // 2008 Dresden University of Technology and the Trustees of Indiana University. 00005 // All rights reserved. 00006 // Authors: Peter Gottschling and Andrew Lumsdaine 00007 // 00008 // This file is part of the Matrix Template Library 00009 // 00010 // See also license.mtl.txt in the distribution. 00011 00012 #ifndef META_MATH_IS_POWER_OF_2_INCLUDE 00013 #define META_MATH_IS_POWER_OF_2_INCLUDE 00014 00015 #include <boost/numeric/meta_math/least_significant_one_bit.hpp> 00016 00017 namespace meta_math { 00018 00019 template <unsigned long X> 00020 struct is_power_of_2 00021 { 00022 static const bool value= X == least_significant_one_bit<X>::value; 00023 }; 00024 00025 } // namespace meta_math 00026 00027 #endif // META_MATH_IS_POWER_OF_2_INCLUDE