/usr/include/stxxl/bits/common
NameSizeModeActions
addressable_queues.h60360644editdlrm
aligned_alloc.h53870644editdlrm
binary_buffer.h200630644editdlrm
cmdline.h234820644editdlrm
condition_variable.h21410644editdlrm
counting_ptr.h164040644editdlrm
error_handling.h77020644editdlrm
exceptions.h20000644editdlrm
exithandler.h14000644editdlrm
external_shared_ptr.h37600644editdlrm
is_sorted.h18180644editdlrm
log.h12650644editdlrm
mutex.h33320644editdlrm
new_alloc.h39010644editdlrm
onoff_switch.h21460644editdlrm
rand.h81910644editdlrm
seed.h8630644editdlrm
semaphore.h24490644editdlrm
settings.h9710644editdlrm
simple_vector.h46390644editdlrm
state.h16870644editdlrm
timer.h46620644editdlrm
tmeta.h29880644editdlrm
tuple.h195530644editdlrm
types.h19230644editdlrm
uint_types.h95720644editdlrm
utils.h83800644editdlrm
Edit: /usr/include/stxxl/bits/common/tmeta.h (2988B)
/*************************************************************************** * include/stxxl/bits/common/tmeta.h * * Template Metaprogramming Tools * (from the Generative Programming book Krysztof Czarnecki, Ulrich Eisenecker) * * Part of the STXXL. See http://stxxl.sourceforge.net * * Copyright (C) 2003 Roman Dementiev * Copyright (C) 2008 Andreas Beckmann * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) **************************************************************************/ #ifndef STXXL_COMMON_TMETA_HEADER #define STXXL_COMMON_TMETA_HEADER #include #include STXXL_BEGIN_NAMESPACE //! IF template metaprogramming statement. //! //! If \c Flag is \c true then \c IF<>::result is of type Type1 //! otherwise of \c IF<>::result is of type Type2 template struct IF { typedef Type1 result; }; template struct IF { typedef Type2 result; }; //! If \c Flag is \c true then \c IF<>::result is Num1 //! otherwise of \c IF<>::result is Num2 template struct IF_N { enum { result = Num1 }; }; template struct IF_N { enum { result = Num2 }; }; const int DEFAULT = ~(~0u >> 1); // initialize with the smallest int struct NilCase { }; template struct CASE { enum { tag = tag_ }; typedef Type_ Type; typedef Next_ Next; }; template class SWITCH { typedef typename Case::Next NextCase; enum { caseTag = Case::tag, found = (caseTag == tag || caseTag == DEFAULT) }; public: typedef typename IF::result >::result result; }; template class SWITCH { public: typedef NilCase result; }; //! \internal, use LOG2 instead template class LOG2_floor { public: enum { value = LOG2_floor::value + 1 }; }; template <> class LOG2_floor<1> { public: enum { value = 0 }; }; template <> class LOG2_floor<0> { public: enum { value = 0 }; }; template class LOG2 { public: enum { floor = LOG2_floor::value, ceil = LOG2_floor::value + 1 }; }; template <> class LOG2<1> { public: enum { floor = 0, ceil = 0 }; }; template <> class LOG2<0> { public: enum { floor = 0, ceil = 0 }; }; STXXL_END_NAMESPACE #endif // !STXXL_COMMON_TMETA_HEADER