/*-----------------------------------------------------------------------------+ Copyright (c) 2008-2011: Joachim Faulhaber +------------------------------------------------------------------------------+ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENCE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +-----------------------------------------------------------------------------*/ #ifndef BOOST_ICL_TYPE_TRAITS_SUCC_PRED_HPP_JOFA_080913 #define BOOST_ICL_TYPE_TRAITS_SUCC_PRED_HPP_JOFA_080913 #include namespace boost{ namespace icl { template inline static IncrementableT succ(IncrementableT x) { return ++x; } template inline static DecrementableT pred(DecrementableT x) { return --x; } namespace detail { template struct successor; template struct successor { typedef successor type; inline static DomainT apply(DomainT value){ return ++value; } }; template struct successor { typedef successor type; inline static DomainT apply(DomainT value){ return --value; } }; template struct predecessor; template struct predecessor { typedef predecessor type; inline static DomainT apply(DomainT value){ return --value; } }; template struct predecessor { typedef predecessor type; inline static DomainT apply(DomainT value){ return ++value; } }; } // namespace detail //------------------------------------------------------------------------------ template struct successor { inline static DomainT apply(DomainT value) { return detail::successor ::value>::apply(value); } }; template struct predecessor { inline static DomainT apply(DomainT value) { return detail::predecessor ::value>::apply(value); } }; }} // namespace boost icl #endif