/*-----------------------------------------------------------------------------+ Interval Container Library Author: Joachim Faulhaber Copyright (c) 2007-2010: Joachim Faulhaber Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin +------------------------------------------------------------------------------+ 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) +-----------------------------------------------------------------------------*/ /** Example interval.cpp \file interval.cpp \brief Intervals for integral and continuous instance types. Closed and open interval borders. Much of the library code deals with intervals which are implemented by interval class templates. This program gives a very short samlpe of different interval instances. \include interval_/interval.cpp */ //[example_interval #include #include #include // Dynamically bounded intervals #include #include // Statically bounded intervals #include #include #include #include #include "../toytime.hpp" #include using namespace std; using namespace boost; using namespace boost::icl; int main() { cout << ">>Interval Container Library: Sample interval.cpp <<\n"; cout << "----------------------------------------------------\n"; // Class template discrete_interval can be used for discrete data types // like integers, date and time and other types that have a least steppable // unit. discrete_interval int_interval = construct >(3, 7, interval_bounds::closed()); // Class template continuous_interval can be used for continuous data types // like double, boost::rational or strings. continuous_interval sqrt_interval = construct >(1/sqrt(2.0), sqrt(2.0)); //interval_bounds::right_open() is default continuous_interval city_interval = construct >("Barcelona", "Boston", interval_bounds::left_open()); discrete_interval