/usr/include/boost/date_time
NameSizeModeActions
gregorian/-0755rm
local_time/-0755rm
posix_time/-0755rm
adjust_functors.hpp54670644editdlrm
compiler_config.hpp56400644editdlrm
constrained_value.hpp42240644editdlrm
c_local_time_adjustor.hpp26310644editdlrm
c_time.hpp44960644editdlrm
date.hpp73570644editdlrm
date_clock_device.hpp22990644editdlrm
date_defs.hpp7010644editdlrm
date_duration.hpp46690644editdlrm
date_duration_types.hpp91860644editdlrm
date_facet.hpp293140644editdlrm
date_formatting.hpp42080644editdlrm
date_formatting_limited.hpp34610644editdlrm
date_formatting_locales.hpp67480644editdlrm
date_format_simple.hpp31280644editdlrm
date_generators.hpp165080644editdlrm
date_generator_formatter.hpp117150644editdlrm
date_generator_parser.hpp130640644editdlrm
date_iterator.hpp33050644editdlrm
date_names_put.hpp107540644editdlrm
date_parsing.hpp141460644editdlrm
dst_rules.hpp154010644editdlrm
dst_transition_generators.hpp22930644editdlrm
filetime_functions.hpp31630644editdlrm
find_match.hpp13550644editdlrm
format_date_parser.hpp239090644editdlrm
gregorian_calendar.hpp27140644editdlrm
gregorian_calendar.ipp79470644editdlrm
int_adapter.hpp144630644editdlrm
iso_format.hpp56400644editdlrm
locale_config.hpp12060644editdlrm
local_timezone_defs.hpp76180644editdlrm
local_time_adjustor.hpp85780644editdlrm
microsec_time_clock.hpp62570644editdlrm
parse_format_base.hpp9610644editdlrm
period.hpp119360644editdlrm
period_formatter.hpp72370644editdlrm
period_parser.hpp79320644editdlrm
special_defs.hpp6330644editdlrm
special_values_formatter.hpp36570644editdlrm
special_values_parser.hpp61610644editdlrm
strings_from_facet.hpp45050644editdlrm
string_convert.hpp10020644editdlrm
string_parse_tree.hpp84050644editdlrm
time.hpp67880644editdlrm
time_clock.hpp22450644editdlrm
time_defs.hpp9420644editdlrm
time_duration.hpp105690644editdlrm
time_facet.hpp589880644editdlrm
time_formatting_streams.hpp37520644editdlrm
time_iterator.hpp14380644editdlrm
time_parsing.hpp118460644editdlrm
time_resolution_traits.hpp67600644editdlrm
time_system_counted.hpp90510644editdlrm
time_system_split.hpp80770644editdlrm
time_zone_base.hpp37110644editdlrm
time_zone_names.hpp31030644editdlrm
tz_db_base.hpp159150644editdlrm
wrapping_int.hpp58240644editdlrm
year_month_day.hpp13750644editdlrm
Edit: /usr/include/boost/date_time/constrained_value.hpp (4224B)
#ifndef CONSTRAINED_VALUE_HPP___ #define CONSTRAINED_VALUE_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland * $Date$ */ #include #include #include #include #include #include namespace boost { //! Namespace containing constrained_value template and types namespace CV { //! Represent a min or max violation type enum violation_enum {min_violation, max_violation}; //! A template to specify a constrained basic value type /*! This template provides a quick way to generate * an integer type with a constrained range. The type * provides for the ability to specify the min, max, and * and error handling policy. * * value policies * A class that provides the range limits via the min and * max functions as well as a function on_error that * determines how errors are handled. A common strategy * would be to assert or throw and exception. The on_error * is passed both the current value and the new value that * is in error. * */ template class BOOST_SYMBOL_VISIBLE constrained_value { public: typedef typename value_policies::value_type value_type; // typedef except_type exception_type; BOOST_CXX14_CONSTEXPR constrained_value(value_type value) : value_((min)()) { assign(value); } BOOST_CXX14_CONSTEXPR constrained_value& operator=(value_type v) { assign(v); return *this; } //! Return the max allowed value (traits method) static BOOST_CONSTEXPR value_type max BOOST_PREVENT_MACRO_SUBSTITUTION () {return (value_policies::max)();} //! Return the min allowed value (traits method) static BOOST_CONSTEXPR value_type min BOOST_PREVENT_MACRO_SUBSTITUTION () {return (value_policies::min)();} //! Coerce into the representation type BOOST_CXX14_CONSTEXPR operator value_type() const {return value_;} protected: value_type value_; private: BOOST_CXX14_CONSTEXPR void assign(value_type value) { //adding 1 below gets rid of a compiler warning which occurs when the //min_value is 0 and the type is unsigned.... if (value+1 < (min)()+1) { value_policies::on_error(value_, value, min_violation); return; } if (value > (max)()) { value_policies::on_error(value_, value, max_violation); return; } value_ = value; } }; //! Template to shortcut the constrained_value policy creation process template class BOOST_SYMBOL_VISIBLE simple_exception_policy { struct BOOST_SYMBOL_VISIBLE exception_wrapper : public exception_type { // In order to support throw_exception mechanism in the BOOST_NO_EXCEPTIONS mode, // we'll have to provide a way to acquire std::exception from the exception being thrown. // However, we cannot derive from it, since it would make it interceptable by this class, // which might not be what the user wanted. operator std::out_of_range () const { // TODO: Make the message more descriptive by using arguments to on_error return std::out_of_range("constrained value boundary has been violated"); } }; typedef typename conditional< is_base_of< std::exception, exception_type >::value, exception_type, exception_wrapper >::type actual_exception_type; public: typedef rep_type value_type; static BOOST_CONSTEXPR rep_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return min_value; } static BOOST_CONSTEXPR rep_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return max_value; } static void on_error(rep_type, rep_type, violation_enum) { boost::throw_exception(actual_exception_type()); } }; } } //namespace CV #endif