├── AUTHORS.txt ├── LICENSE.txt ├── book ├── boost.accumulators.xml ├── boost.algorithm.xml ├── boost.any.xml ├── boost.array.xml ├── boost.asio.xml ├── boost.assign.xml ├── boost.atomic.xml ├── boost.bimap.xml ├── boost.bind.xml ├── boost.chrono.xml ├── boost.circularbuffer.xml ├── boost.compressed_pair.xml ├── boost.container.xml ├── boost.conversion.xml ├── boost.coroutine.xml ├── boost.datetime.xml ├── boost.dynamicbitset.xml ├── boost.enableif.xml ├── boost.exception.xml ├── boost.filesystem.xml ├── boost.flyweight.xml ├── boost.foreach.xml ├── boost.format.xml ├── boost.function.xml ├── boost.fusion.xml ├── boost.graph.xml ├── boost.heap.xml ├── boost.integer.xml ├── boost.interprocess.xml ├── boost.intrusive.xml ├── boost.iostreams.xml ├── boost.lambda.xml ├── boost.lexical_cast.xml ├── boost.lockfree.xml ├── boost.log.xml ├── boost.minmax.xml ├── boost.mpi.xml ├── boost.msm.xml ├── boost.multiarray.xml ├── boost.multiindex.xml ├── boost.numeric_conversion.xml ├── boost.operators.xml ├── boost.optional.xml ├── boost.parameter.xml ├── boost.phoenix.xml ├── boost.pool.xml ├── boost.program_options.xml ├── boost.propertytree.xml ├── boost.ptr_container.xml ├── boost.random.xml ├── boost.range.xml ├── boost.ref.xml ├── boost.regex.xml ├── boost.scope_exit.xml ├── boost.serialization.xml ├── boost.signals2.xml ├── boost.smartpointers.xml ├── boost.spirit.xml ├── boost.stringalgorithms.xml ├── boost.swap.xml ├── boost.system.xml ├── boost.thread.xml ├── boost.timer.xml ├── boost.tokenizer.xml ├── boost.tribool.xml ├── boost.tuple.xml ├── boost.typetraits.xml ├── boost.unordered.xml ├── boost.utility.xml ├── boost.uuid.xml ├── boost.variant.xml ├── boost.xpressive.xml ├── colophon.xml ├── index.xml └── introduction.xml ├── examples ├── Jamroot.jam ├── accumulators_01 │ ├── Jamfile.jam │ └── main.cpp ├── accumulators_02 │ ├── Jamfile.jam │ └── main.cpp ├── accumulators_03 │ ├── Jamfile.jam │ └── main.cpp ├── algorithm_01 │ ├── Jamfile.jam │ └── main.cpp ├── algorithm_02 │ ├── Jamfile.jam │ └── main.cpp ├── algorithm_03 │ ├── Jamfile.jam │ └── main.cpp ├── algorithm_04 │ ├── Jamfile.jam │ └── main.cpp ├── any_01 │ ├── Jamfile.jam │ └── main.cpp ├── any_02 │ ├── Jamfile.jam │ └── main.cpp ├── any_03 │ ├── Jamfile.jam │ └── main.cpp ├── any_04 │ ├── Jamfile.jam │ └── main.cpp ├── any_05 │ ├── Jamfile.jam │ └── main.cpp ├── any_06 │ ├── Jamfile.jam │ └── main.cpp ├── array_01 │ ├── Jamfile.jam │ └── main.cpp ├── asio_01 │ ├── Jamfile.jam │ └── main.cpp ├── asio_02 │ ├── Jamfile.jam │ └── main.cpp ├── asio_03 │ ├── Jamfile.jam │ └── main.cpp ├── asio_04 │ ├── Jamfile.jam │ └── main.cpp ├── asio_05 │ ├── Jamfile.jam │ └── main.cpp ├── asio_06 │ ├── Jamfile.jam │ └── main.cpp ├── asio_07 │ ├── Jamfile.jam │ └── main.cpp ├── asio_08 │ ├── Jamfile.jam │ └── main.cpp ├── asio_09 │ ├── Jamfile.jam │ └── main.cpp ├── asio_10 │ ├── Jamfile.jam │ └── main.cpp ├── assign_01 │ ├── Jamfile.jam │ └── main.cpp ├── assign_02 │ ├── Jamfile.jam │ └── main.cpp ├── atomic_01 │ ├── Jamfile.jam │ └── main.cpp ├── atomic_02 │ ├── Jamfile.jam │ └── main.cpp ├── atomic_03 │ ├── Jamfile.jam │ └── main.cpp ├── atomic_04 │ ├── Jamfile.jam │ └── main.cpp ├── atomic_05 │ ├── Jamfile.jam │ └── main.cpp ├── bimap_01 │ ├── Jamfile.jam │ └── main.cpp ├── bimap_02 │ ├── Jamfile.jam │ └── main.cpp ├── bimap_03 │ ├── Jamfile.jam │ └── main.cpp ├── bimap_04 │ ├── Jamfile.jam │ └── main.cpp ├── bimap_05 │ ├── Jamfile.jam │ └── main.cpp ├── bind_01 │ ├── Jamfile.jam │ └── main.cpp ├── bind_02 │ ├── Jamfile.jam │ └── main.cpp ├── bind_03 │ ├── Jamfile.jam │ └── main.cpp ├── bind_04 │ ├── Jamfile.jam │ └── main.cpp ├── bind_05 │ ├── Jamfile.jam │ └── main.cpp ├── chrono_01 │ ├── Jamfile.jam │ └── main.cpp ├── chrono_02 │ ├── Jamfile.jam │ └── main.cpp ├── chrono_03 │ ├── Jamfile.jam │ └── main.cpp ├── chrono_04 │ ├── Jamfile.jam │ └── main.cpp ├── chrono_05 │ ├── Jamfile.jam │ └── main.cpp ├── chrono_06 │ ├── Jamfile.jam │ └── main.cpp ├── circularbuffer_01 │ ├── Jamfile.jam │ └── main.cpp ├── circularbuffer_02 │ ├── Jamfile.jam │ └── main.cpp ├── compressedpair_01 │ ├── Jamfile.jam │ └── main.cpp ├── container_01 │ ├── Jamfile.jam │ └── main.cpp ├── container_02 │ ├── Jamfile.jam │ └── main.cpp ├── conversion_01 │ ├── Jamfile.jam │ └── main.cpp ├── conversion_02 │ ├── Jamfile.jam │ └── main.cpp ├── coroutine_01 │ ├── Jamfile.jam │ └── main.cpp ├── coroutine_02 │ ├── Jamfile.jam │ └── main.cpp ├── coroutine_03 │ ├── Jamfile.jam │ └── main.cpp ├── coroutine_04 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_01 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_02 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_03 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_04 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_05 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_06 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_07 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_08 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_09 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_10 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_11 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_12 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_13 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_14 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_15 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_16 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_17 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_18 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_19 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_20 │ ├── Jamfile.jam │ └── main.cpp ├── datetime_21 │ ├── Jamfile.jam │ └── main.cpp ├── dynamicbitset_01 │ ├── Jamfile.jam │ └── main.cpp ├── enableif_01 │ ├── Jamfile.jam │ └── main.cpp ├── enableif_02 │ ├── Jamfile.jam │ └── main.cpp ├── exception_01 │ ├── Jamfile.jam │ └── main.cpp ├── exception_02 │ ├── Jamfile.jam │ └── main.cpp ├── exception_03 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_01 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_02 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_03 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_04 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_05 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_06 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_07 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_08 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_09 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_10 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_11 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_12 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_13 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_14 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_15 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_16 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_17 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_18 │ ├── Jamfile.jam │ └── main.cpp ├── filesystem_19 │ ├── Jamfile.jam │ └── main.cpp ├── flyweight_01 │ ├── Jamfile.jam │ └── main.cpp ├── flyweight_02 │ ├── Jamfile.jam │ └── main.cpp ├── flyweight_03 │ ├── Jamfile.jam │ └── main.cpp ├── flyweight_04 │ ├── Jamfile.jam │ └── main.cpp ├── flyweight_05 │ ├── Jamfile.jam │ └── main.cpp ├── foreach_01 │ ├── Jamfile.jam │ └── main.cpp ├── format_01 │ ├── Jamfile.jam │ └── main.cpp ├── format_02 │ ├── Jamfile.jam │ └── main.cpp ├── format_03 │ ├── Jamfile.jam │ └── main.cpp ├── format_04 │ ├── Jamfile.jam │ └── main.cpp ├── format_05 │ ├── Jamfile.jam │ └── main.cpp ├── format_06 │ ├── Jamfile.jam │ └── main.cpp ├── format_07 │ ├── Jamfile.jam │ └── main.cpp ├── format_08 │ ├── Jamfile.jam │ └── main.cpp ├── format_09 │ ├── Jamfile.jam │ └── main.cpp ├── function_01 │ ├── Jamfile.jam │ └── main.cpp ├── function_02 │ ├── Jamfile.jam │ └── main.cpp ├── function_03 │ ├── Jamfile.jam │ └── main.cpp ├── fusion_01 │ ├── Jamfile.jam │ └── main.cpp ├── fusion_02 │ ├── Jamfile.jam │ └── main.cpp ├── fusion_03 │ ├── Jamfile.jam │ └── main.cpp ├── fusion_04 │ ├── Jamfile.jam │ └── main.cpp ├── fusion_05 │ ├── Jamfile.jam │ └── main.cpp ├── fusion_06 │ ├── Jamfile.jam │ └── main.cpp ├── fusion_07 │ ├── Jamfile.jam │ └── main.cpp ├── fusion_08 │ ├── Jamfile.jam │ └── main.cpp ├── graph_01 │ ├── Jamfile.jam │ └── main.cpp ├── graph_02 │ ├── Jamfile.jam │ └── main.cpp ├── graph_03 │ ├── Jamfile.jam │ └── main.cpp ├── graph_04 │ ├── Jamfile.jam │ └── main.cpp ├── graph_05 │ ├── Jamfile.jam │ └── main.cpp ├── graph_06 │ ├── Jamfile.jam │ └── main.cpp ├── graph_07 │ ├── Jamfile.jam │ └── main.cpp ├── graph_08 │ ├── Jamfile.jam │ └── main.cpp ├── graph_09 │ ├── Jamfile.jam │ └── main.cpp ├── graph_10 │ ├── Jamfile.jam │ └── main.cpp ├── graph_11 │ ├── Jamfile.jam │ └── main.cpp ├── graph_12 │ ├── Jamfile.jam │ └── main.cpp ├── graph_13 │ ├── Jamfile.jam │ └── main.cpp ├── graph_14 │ ├── Jamfile.jam │ └── main.cpp ├── graph_15 │ ├── Jamfile.jam │ └── main.cpp ├── graph_16 │ ├── Jamfile.jam │ └── main.cpp ├── heap_01 │ ├── Jamfile.jam │ └── main.cpp ├── heap_02 │ ├── Jamfile.jam │ └── main.cpp ├── heap_03 │ ├── Jamfile.jam │ └── main.cpp ├── integer_01 │ ├── Jamfile.jam │ └── main.cpp ├── integer_02 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_01 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_02 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_03 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_04 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_05 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_06 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_07 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_08 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_09 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_10 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_11 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_12 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_13 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_14 │ ├── Jamfile.jam │ └── main.cpp ├── interprocess_15 │ ├── Jamfile.jam │ └── main.cpp ├── intrusive_01 │ ├── Jamfile.jam │ └── main.cpp ├── intrusive_02 │ ├── Jamfile.jam │ └── main.cpp ├── intrusive_03 │ ├── Jamfile.jam │ └── main.cpp ├── intrusive_04 │ ├── Jamfile.jam │ └── main.cpp ├── intrusive_05 │ ├── Jamfile.jam │ └── main.cpp ├── iostreams_01 │ ├── Jamfile.jam │ └── main.cpp ├── iostreams_02 │ ├── Jamfile.jam │ └── main.cpp ├── iostreams_03 │ ├── Jamfile.jam │ └── main.cpp ├── iostreams_04 │ ├── Jamfile.jam │ └── main.cpp ├── iostreams_05 │ ├── Jamfile.jam │ └── main.cpp ├── iostreams_06 │ ├── Jamfile.jam │ └── main.cpp ├── iostreams_07 │ ├── Jamfile.jam │ └── main.cpp ├── iostreams_08 │ ├── Jamfile.jam │ └── main.cpp ├── lambda_01 │ ├── Jamfile.jam │ └── main.cpp ├── lambda_02 │ ├── Jamfile.jam │ └── main.cpp ├── lexical_cast_01 │ ├── Jamfile.jam │ └── main.cpp ├── lexical_cast_02 │ ├── Jamfile.jam │ └── main.cpp ├── lockfree_01 │ ├── Jamfile.jam │ └── main.cpp ├── lockfree_02 │ ├── Jamfile.jam │ └── main.cpp ├── lockfree_03 │ ├── Jamfile.jam │ └── main.cpp ├── lockfree_04 │ ├── Jamfile.jam │ └── main.cpp ├── log_01 │ ├── Jamfile.jam │ └── main.cpp ├── log_02 │ ├── Jamfile.jam │ └── main.cpp ├── log_03 │ ├── Jamfile.jam │ └── main.cpp ├── log_04 │ ├── Jamfile.jam │ └── main.cpp ├── log_05 │ ├── Jamfile.jam │ └── main.cpp ├── log_06 │ ├── Jamfile.jam │ └── main.cpp ├── log_07 │ ├── Jamfile.jam │ └── main.cpp ├── log_08 │ ├── Jamfile.jam │ └── main.cpp ├── log_09 │ ├── Jamfile.jam │ └── main.cpp ├── log_10 │ ├── Jamfile.jam │ └── main.cpp ├── metastatemachine_01 │ ├── Jamfile.jam │ └── main.cpp ├── metastatemachine_02 │ ├── Jamfile.jam │ └── main.cpp ├── metastatemachine_03 │ ├── Jamfile.jam │ └── main.cpp ├── metastatemachine_04 │ ├── Jamfile.jam │ └── main.cpp ├── metastatemachine_05 │ ├── Jamfile.jam │ └── main.cpp ├── metastatemachine_06 │ ├── Jamfile.jam │ └── main.cpp ├── minmax_01 │ ├── Jamfile.jam │ └── main.cpp ├── minmax_02 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_01 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_02 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_03 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_04 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_05 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_06 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_07 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_08 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_09 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_10 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_11 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_12 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_13 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_14 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_15 │ ├── Jamfile.jam │ └── main.cpp ├── mpi_16 │ ├── Jamfile.jam │ └── main.cpp ├── multiarray_01 │ ├── Jamfile.jam │ └── main.cpp ├── multiarray_02 │ ├── Jamfile.jam │ └── main.cpp ├── multiarray_03 │ ├── Jamfile.jam │ └── main.cpp ├── multiindex_01 │ ├── Jamfile.jam │ └── main.cpp ├── multiindex_02 │ ├── Jamfile.jam │ └── main.cpp ├── multiindex_03 │ ├── Jamfile.jam │ └── main.cpp ├── multiindex_04 │ ├── Jamfile.jam │ └── main.cpp ├── multiindex_05 │ ├── Jamfile.jam │ └── main.cpp ├── numeric_conversion_01 │ ├── Jamfile.jam │ └── main.cpp ├── numeric_conversion_02 │ ├── Jamfile.jam │ └── main.cpp ├── numeric_conversion_03 │ ├── Jamfile.jam │ └── main.cpp ├── operators_01 │ ├── Jamfile.jam │ └── main.cpp ├── optional_01 │ ├── Jamfile.jam │ └── main.cpp ├── optional_02 │ ├── Jamfile.jam │ └── main.cpp ├── optional_03 │ ├── Jamfile.jam │ └── main.cpp ├── optional_04 │ ├── Jamfile.jam │ └── main.cpp ├── parameter_01 │ ├── Jamfile.jam │ └── main.cpp ├── parameter_02 │ ├── Jamfile.jam │ └── main.cpp ├── parameter_03 │ ├── Jamfile.jam │ └── main.cpp ├── parameter_04 │ ├── Jamfile.jam │ └── main.cpp ├── phoenix_01 │ ├── Jamfile.jam │ └── main.cpp ├── phoenix_02 │ ├── Jamfile.jam │ └── main.cpp ├── phoenix_03 │ ├── Jamfile.jam │ └── main.cpp ├── phoenix_04 │ ├── Jamfile.jam │ └── main.cpp ├── phoenix_05 │ ├── Jamfile.jam │ └── main.cpp ├── phoenix_06 │ ├── Jamfile.jam │ └── main.cpp ├── phoenix_07 │ ├── Jamfile.jam │ └── main.cpp ├── phoenix_08 │ ├── Jamfile.jam │ └── main.cpp ├── phoenix_09 │ ├── Jamfile.jam │ └── main.cpp ├── pool_01 │ ├── Jamfile.jam │ └── main.cpp ├── pool_02 │ ├── Jamfile.jam │ └── main.cpp ├── pool_03 │ ├── Jamfile.jam │ └── main.cpp ├── pool_04 │ ├── Jamfile.jam │ └── main.cpp ├── pool_05 │ ├── Jamfile.jam │ └── main.cpp ├── pool_06 │ ├── Jamfile.jam │ └── main.cpp ├── program_options_01 │ ├── Jamfile.jam │ └── main.cpp ├── program_options_02 │ ├── Jamfile.jam │ └── main.cpp ├── program_options_03 │ ├── Jamfile.jam │ └── main.cpp ├── program_options_04 │ ├── Jamfile.jam │ ├── config.txt │ └── main.cpp ├── propertytree_01 │ ├── Jamfile.jam │ └── main.cpp ├── propertytree_02 │ ├── Jamfile.jam │ └── main.cpp ├── propertytree_03 │ ├── Jamfile.jam │ └── main.cpp ├── propertytree_04 │ ├── Jamfile.jam │ └── main.cpp ├── propertytree_05 │ ├── Jamfile.jam │ └── main.cpp ├── ptr_container_01 │ ├── Jamfile.jam │ └── main.cpp ├── ptr_container_02 │ ├── Jamfile.jam │ └── main.cpp ├── ptr_container_03 │ ├── Jamfile.jam │ └── main.cpp ├── random_01 │ ├── Jamfile.jam │ └── main.cpp ├── random_02 │ ├── Jamfile.jam │ └── main.cpp ├── random_03 │ ├── Jamfile.jam │ └── main.cpp ├── random_04 │ ├── Jamfile.jam │ └── main.cpp ├── range_01 │ ├── Jamfile.jam │ └── main.cpp ├── range_02 │ ├── Jamfile.jam │ └── main.cpp ├── range_03 │ ├── Jamfile.jam │ └── main.cpp ├── range_04 │ ├── Jamfile.jam │ └── main.cpp ├── range_05 │ ├── Jamfile.jam │ └── main.cpp ├── range_06 │ ├── Jamfile.jam │ └── main.cpp ├── range_07 │ ├── Jamfile.jam │ └── main.cpp ├── range_08 │ ├── Jamfile.jam │ └── main.cpp ├── range_09 │ ├── Jamfile.jam │ └── main.cpp ├── ref_01 │ ├── Jamfile.jam │ └── main.cpp ├── regex_01 │ ├── Jamfile.jam │ └── main.cpp ├── regex_02 │ ├── Jamfile.jam │ └── main.cpp ├── regex_03 │ ├── Jamfile.jam │ └── main.cpp ├── regex_04 │ ├── Jamfile.jam │ └── main.cpp ├── regex_05 │ ├── Jamfile.jam │ └── main.cpp ├── regex_06 │ ├── Jamfile.jam │ └── main.cpp ├── regex_07 │ ├── Jamfile.jam │ └── main.cpp ├── regex_08 │ ├── Jamfile.jam │ └── main.cpp ├── scopeexit_01 │ ├── Jamfile.jam │ └── main.cpp ├── scopeexit_02 │ ├── Jamfile.jam │ └── main.cpp ├── scopeexit_03 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_01 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_02 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_03 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_04 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_05 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_06 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_07 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_08 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_09 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_10 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_11 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_12 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_13 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_14 │ ├── Jamfile.jam │ └── main.cpp ├── serialization_15 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_01 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_02 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_03 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_04 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_05 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_06 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_07 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_08 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_09 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_10 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_11 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_12 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_13 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_14 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_15 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_16 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_17 │ ├── Jamfile.jam │ └── main.cpp ├── signals2_18 │ ├── Jamfile.jam │ └── main.cpp ├── smartpointers_01 │ ├── Jamfile.jam │ └── main.cpp ├── smartpointers_02 │ ├── Jamfile.jam │ └── main.cpp ├── smartpointers_03 │ ├── Jamfile.jam │ └── main.cpp ├── smartpointers_04 │ ├── Jamfile.jam │ └── main.cpp ├── smartpointers_05 │ ├── Jamfile.jam │ └── main.cpp ├── smartpointers_06 │ ├── Jamfile.jam │ └── main.cpp ├── smartpointers_07 │ ├── Jamfile.jam │ └── main.cpp ├── smartpointers_08 │ ├── Jamfile.jam │ └── main.cpp ├── smartpointers_09 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_01 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_02 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_03 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_04 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_05 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_06 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_07 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_08 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_09 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_10 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_11 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_12 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_13 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_14 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_15 │ ├── Jamfile.jam │ └── main.cpp ├── spirit_16 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_01 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_02 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_03 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_04 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_05 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_06 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_07 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_08 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_09 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_10 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_11 │ ├── Jamfile.jam │ └── main.cpp ├── stringalgorithms_12 │ ├── Jamfile.jam │ └── main.cpp ├── swap_01 │ ├── Jamfile.jam │ └── main.cpp ├── system_01 │ ├── Jamfile.jam │ └── main.cpp ├── system_02 │ ├── Jamfile.jam │ └── main.cpp ├── system_03 │ ├── Jamfile.jam │ └── main.cpp ├── system_04 │ ├── Jamfile.jam │ └── main.cpp ├── system_05 │ ├── Jamfile.jam │ └── main.cpp ├── thread_01 │ ├── Jamfile.jam │ └── main.cpp ├── thread_02 │ ├── Jamfile.jam │ └── main.cpp ├── thread_03 │ ├── Jamfile.jam │ └── main.cpp ├── thread_04 │ ├── Jamfile.jam │ └── main.cpp ├── thread_05 │ ├── Jamfile.jam │ └── main.cpp ├── thread_06 │ ├── Jamfile.jam │ └── main.cpp ├── thread_07 │ ├── Jamfile.jam │ └── main.cpp ├── thread_08 │ ├── Jamfile.jam │ └── main.cpp ├── thread_09 │ ├── Jamfile.jam │ └── main.cpp ├── thread_10 │ ├── Jamfile.jam │ └── main.cpp ├── thread_11 │ ├── Jamfile.jam │ └── main.cpp ├── thread_12 │ ├── Jamfile.jam │ └── main.cpp ├── thread_13 │ ├── Jamfile.jam │ └── main.cpp ├── thread_14 │ ├── Jamfile.jam │ └── main.cpp ├── thread_15 │ ├── Jamfile.jam │ └── main.cpp ├── thread_16 │ ├── Jamfile.jam │ └── main.cpp ├── timer_01 │ ├── Jamfile.jam │ └── main.cpp ├── timer_02 │ ├── Jamfile.jam │ └── main.cpp ├── timer_03 │ ├── Jamfile.jam │ └── main.cpp ├── timer_04 │ ├── Jamfile.jam │ └── main.cpp ├── tokenizer_01 │ ├── Jamfile.jam │ └── main.cpp ├── tokenizer_02 │ ├── Jamfile.jam │ └── main.cpp ├── tokenizer_03 │ ├── Jamfile.jam │ └── main.cpp ├── tokenizer_04 │ ├── Jamfile.jam │ └── main.cpp ├── tokenizer_05 │ ├── Jamfile.jam │ └── main.cpp ├── tokenizer_06 │ ├── Jamfile.jam │ └── main.cpp ├── tokenizer_07 │ ├── Jamfile.jam │ └── main.cpp ├── tribool_01 │ ├── Jamfile.jam │ └── main.cpp ├── tribool_02 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_01 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_02 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_03 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_04 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_05 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_06 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_07 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_08 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_09 │ ├── Jamfile.jam │ └── main.cpp ├── tuple_10 │ ├── Jamfile.jam │ └── main.cpp ├── typetraits_01 │ ├── Jamfile.jam │ └── main.cpp ├── typetraits_02 │ ├── Jamfile.jam │ └── main.cpp ├── typetraits_03 │ ├── Jamfile.jam │ └── main.cpp ├── typetraits_04 │ ├── Jamfile.jam │ └── main.cpp ├── unordered_01 │ ├── Jamfile.jam │ └── main.cpp ├── unordered_02 │ ├── Jamfile.jam │ └── main.cpp ├── unordered_03 │ ├── Jamfile.jam │ └── main.cpp ├── utility_01 │ ├── Jamfile.jam │ └── main.cpp ├── utility_02 │ ├── Jamfile.jam │ └── main.cpp ├── utility_03 │ ├── Jamfile.jam │ └── main.cpp ├── utility_04 │ ├── Jamfile.jam │ └── main.cpp ├── utility_05 │ ├── Jamfile.jam │ └── main.cpp ├── utility_06 │ ├── Jamfile.jam │ └── main.cpp ├── utility_07 │ ├── Jamfile.jam │ └── main.cpp ├── uuid_01 │ ├── Jamfile.jam │ └── main.cpp ├── uuid_02 │ ├── Jamfile.jam │ └── main.cpp ├── uuid_03 │ ├── Jamfile.jam │ └── main.cpp ├── uuid_04 │ ├── Jamfile.jam │ └── main.cpp ├── variant_01 │ ├── Jamfile.jam │ └── main.cpp ├── variant_02 │ ├── Jamfile.jam │ └── main.cpp ├── variant_03 │ ├── Jamfile.jam │ └── main.cpp ├── variant_04 │ ├── Jamfile.jam │ └── main.cpp ├── variant_05 │ ├── Jamfile.jam │ └── main.cpp ├── xpressive_01 │ ├── Jamfile.jam │ └── main.cpp ├── xpressive_02 │ ├── Jamfile.jam │ └── main.cpp ├── xpressive_03 │ ├── Jamfile.jam │ └── main.cpp └── xpressive_04 │ ├── Jamfile.jam │ └── main.cpp └── exercises ├── assign_01 └── main.cpp ├── bimap_01 └── main.cpp ├── enableif_01 └── main.cpp ├── flyweight_01 └── main.cpp ├── fusion_01 └── main.cpp ├── multiindex_01 └── main.cpp ├── propertytree_01 └── config.json ├── scopeexit_01 └── main.cpp └── thread_01 └── main.cpp /AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Boris Schäling 2 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The Boost C++ Libraries (c) by Boris Schäling 2 | 3 | The Boost C++ Libraries is licensed under a 4 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 5 | 6 | You should have received a copy of the license along with this 7 | work. If not, see . 8 | 9 | Exceptions: Examples and exercises are licensed under the Boost Software License 10 | (see ). 11 | -------------------------------------------------------------------------------- /examples/accumulators_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/accumulators_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::accumulators; 6 | 7 | int main() 8 | { 9 | accumulator_set> acc; 10 | acc(4); 11 | acc(-6); 12 | acc(9); 13 | std::cout << count(acc) << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/accumulators_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/accumulators_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::accumulators; 6 | 7 | int main() 8 | { 9 | accumulator_set> acc; 10 | acc(8); 11 | acc(9); 12 | acc(10); 13 | acc(11); 14 | acc(12); 15 | std::cout << mean(acc) << '\n'; 16 | std::cout << variance(acc) << '\n'; 17 | } -------------------------------------------------------------------------------- /examples/accumulators_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/algorithm_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/algorithm_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::algorithm; 6 | 7 | int main() 8 | { 9 | std::array a{{0, 5, 2, 1, 4, 3}}; 10 | auto predicate = [](int i){ return i == 4; }; 11 | std::cout.setf(std::ios::boolalpha); 12 | std::cout << one_of(a.begin(), a.end(), predicate) << '\n'; 13 | std::cout << one_of_equal(a.begin(), a.end(), 4) << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/algorithm_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/algorithm_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/algorithm_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/any_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/any_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | boost::any a = 1; 6 | a = 3.14; 7 | a = true; 8 | } -------------------------------------------------------------------------------- /examples/any_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/any_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::any a = std::string{"Boost"}; 7 | } -------------------------------------------------------------------------------- /examples/any_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/any_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::any a = 1; 7 | std::cout << boost::any_cast(a) << '\n'; 8 | a = 3.14; 9 | std::cout << boost::any_cast(a) << '\n'; 10 | a = true; 11 | std::cout << std::boolalpha << boost::any_cast(a) << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/any_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/any_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | try 7 | { 8 | boost::any a = 1; 9 | std::cout << boost::any_cast(a) << '\n'; 10 | } 11 | catch (boost::bad_any_cast &e) 12 | { 13 | std::cerr << e.what() << '\n'; 14 | } 15 | } -------------------------------------------------------------------------------- /examples/any_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/any_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | boost::any a = 1; 8 | if (!a.empty()) 9 | { 10 | const std::type_info &ti = a.type(); 11 | std::cout << ti.name() << '\n'; 12 | } 13 | } -------------------------------------------------------------------------------- /examples/any_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/any_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::any a = 1; 7 | int *i = boost::any_cast(&a); 8 | std::cout << *i << '\n'; 9 | } -------------------------------------------------------------------------------- /examples/array_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_chrono : windows:_WIN32_WINNT=0x0601 cygwin:no clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace boost::asio; 7 | 8 | int main() 9 | { 10 | io_service ioservice; 11 | 12 | steady_timer timer{ioservice, std::chrono::seconds{3}}; 13 | timer.async_wait([](const boost::system::error_code &ec) 14 | { std::cout << "3 sec\n"; }); 15 | 16 | ioservice.run(); 17 | } -------------------------------------------------------------------------------- /examples/asio_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_chrono : windows:_WIN32_WINNT=0x0601 cygwin:no clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_chrono : windows:_WIN32_WINNT=0x0601 cygwin:no clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_chrono : windows:_WIN32_WINNT=0x0601 cygwin:no clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_chrono : windows:_WIN32_WINNT=0x0601 cygwin:no clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_chrono : windows:_WIN32_WINNT=0x0601 cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_coroutine ..//boost_context ..//boost_thread : windows:_WIN32_WINNT=0x0601 cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_chrono : windows:_WIN32_WINNT=0x0601 cygwin:no linux:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_chrono : windows:_WIN32_WINNT=0x0601 cygwin:no linux:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/asio_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ..//boost_chrono : windows:no cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/assign_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/assign_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/assign_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | std::vector v; 10 | boost::assign::push_back(v)(1)(2)(3); 11 | 12 | std::deque d; 13 | boost::assign::push_front(d)(1)(2)(3); 14 | 15 | std::set s; 16 | boost::assign::insert(s)(1)(2)(3); 17 | 18 | std::queue q; 19 | boost::assign::push(q)(1)(2)(3); 20 | } -------------------------------------------------------------------------------- /examples/atomic_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_atomic : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/atomic_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | boost::atomic a{0}; 6 | 7 | void thread() 8 | { 9 | ++a; 10 | } 11 | 12 | int main() 13 | { 14 | std::thread t1{thread}; 15 | std::thread t2{thread}; 16 | t1.join(); 17 | t2.join(); 18 | std::cout << a << '\n'; 19 | } -------------------------------------------------------------------------------- /examples/atomic_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_atomic ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/atomic_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout.setf(std::ios::boolalpha); 7 | 8 | boost::atomic s; 9 | std::cout << s.is_lock_free() << '\n'; 10 | 11 | boost::atomic i; 12 | std::cout << i.is_lock_free() << '\n'; 13 | 14 | boost::atomic l; 15 | std::cout << l.is_lock_free() << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/atomic_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_atomic : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/atomic_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | boost::atomic a{0}; 6 | 7 | void thread() 8 | { 9 | a.fetch_add(1, boost::memory_order_seq_cst); 10 | } 11 | 12 | int main() 13 | { 14 | std::thread t1{thread}; 15 | std::thread t2{thread}; 16 | t1.join(); 17 | t2.join(); 18 | std::cout << a << '\n'; 19 | } -------------------------------------------------------------------------------- /examples/atomic_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_atomic : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/atomic_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | boost::atomic a{0}; 6 | 7 | void thread() 8 | { 9 | a.fetch_add(1, boost::memory_order_relaxed); 10 | } 11 | 12 | int main() 13 | { 14 | std::thread t1{thread}; 15 | std::thread t2{thread}; 16 | t1.join(); 17 | t2.join(); 18 | std::cout << a << '\n'; 19 | } -------------------------------------------------------------------------------- /examples/atomic_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_atomic : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bimap_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bimap_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::bimap bimap; 8 | bimap animals; 9 | 10 | animals.insert({"cat", 4}); 11 | animals.insert({"shark", 0}); 12 | animals.insert({"spider", 8}); 13 | 14 | std::cout << animals.left.count("cat") << '\n'; 15 | std::cout << animals.right.count(8) << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/bimap_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bimap_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::bimap bimap; 8 | bimap animals; 9 | 10 | animals.insert({"cat", 4}); 11 | animals.insert({"shark", 0}); 12 | animals.insert({"spider", 8}); 13 | 14 | for (auto it = animals.begin(); it != animals.end(); ++it) 15 | std::cout << it->left << " has " << it->right << " legs\n"; 16 | } -------------------------------------------------------------------------------- /examples/bimap_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bimap_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::bimap, 8 | boost::bimaps::set_of> bimap; 9 | bimap animals; 10 | 11 | animals.insert({"cat", 4}); 12 | animals.insert({"shark", 0}); 13 | animals.insert({"spider", 8}); 14 | 15 | std::cout << animals.left.count("spider") << '\n'; 16 | std::cout << animals.right.count(8) << '\n'; 17 | } -------------------------------------------------------------------------------- /examples/bimap_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bimap_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bind_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bind_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void print(int i) 6 | { 7 | std::cout << i << '\n'; 8 | } 9 | 10 | int main() 11 | { 12 | std::vector v{1, 3, 2}; 13 | std::for_each(v.begin(), v.end(), print); 14 | } -------------------------------------------------------------------------------- /examples/bind_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bind_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | class print : public std::binary_function 7 | { 8 | public: 9 | void operator()(std::ostream *os, int i) const 10 | { 11 | *os << i << '\n'; 12 | } 13 | }; 14 | 15 | int main() 16 | { 17 | std::vector v{1, 3, 2}; 18 | std::for_each(v.begin(), v.end(), std::bind1st(print{}, &std::cout)); 19 | } -------------------------------------------------------------------------------- /examples/bind_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bind_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void print(std::ostream *os, int i) 7 | { 8 | *os << i << '\n'; 9 | } 10 | 11 | int main() 12 | { 13 | std::vector v{1, 3, 2}; 14 | std::for_each(v.begin(), v.end(), boost::bind(print, &std::cout, _1)); 15 | } -------------------------------------------------------------------------------- /examples/bind_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bind_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | bool compare(int i, int j) 7 | { 8 | return i > j; 9 | } 10 | 11 | int main() 12 | { 13 | std::vector v{1, 3, 2}; 14 | std::sort(v.begin(), v.end(), boost::bind(compare, _1, _2)); 15 | for (int i : v) 16 | std::cout << i << '\n'; 17 | } -------------------------------------------------------------------------------- /examples/bind_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/bind_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | bool compare(int i, int j) 7 | { 8 | return i > j; 9 | } 10 | 11 | int main() 12 | { 13 | std::vector v{1, 3, 2}; 14 | std::sort(v.begin(), v.end(), boost::bind(compare, _2, _1)); 15 | for (int i : v) 16 | std::cout << i << '\n'; 17 | } -------------------------------------------------------------------------------- /examples/chrono_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_chrono ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/chrono_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_chrono ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/chrono_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::chrono; 5 | 6 | int main() 7 | { 8 | process_real_cpu_clock::time_point p = process_real_cpu_clock::now(); 9 | std::cout << p << '\n'; 10 | std::cout << p - nanoseconds{1} << '\n'; 11 | std::cout << p + milliseconds{1} << '\n'; 12 | std::cout << p + seconds{1} << '\n'; 13 | std::cout << p + minutes{1} << '\n'; 14 | std::cout << p + hours{1} << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/chrono_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_chrono ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/chrono_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::chrono; 5 | 6 | int main() 7 | { 8 | process_real_cpu_clock::time_point p = process_real_cpu_clock::now(); 9 | std::cout << p << '\n'; 10 | std::cout << time_point_cast(p) << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/chrono_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_chrono ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/chrono_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::chrono; 5 | 6 | int main() 7 | { 8 | minutes m{1}; 9 | seconds s{35}; 10 | 11 | std::cout << m + s << '\n'; 12 | std::cout << duration_cast(m + s) << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/chrono_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_chrono ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/chrono_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::chrono; 5 | 6 | int main() 7 | { 8 | std::cout << floor(minutes{1} + seconds{45}) << '\n'; 9 | std::cout << round(minutes{1} + seconds{15}) << '\n'; 10 | std::cout << ceil(minutes{1} + seconds{15}) << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/chrono_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_chrono ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/chrono_06/main.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_CHRONO_VERSION 2 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace boost::chrono; 7 | 8 | int main() 9 | { 10 | std::cout << symbol_format << minutes{10} << '\n'; 11 | 12 | std::cout << time_fmt(boost::chrono::timezone::local, "%H:%M:%S") << 13 | system_clock::now() << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/circularbuffer_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/circularbuffer_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/compressedpair_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/compressedpair_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct empty {}; 6 | 7 | int main() 8 | { 9 | std::pair p; 10 | std::cout << sizeof(p) << '\n'; 11 | 12 | boost::compressed_pair cp; 13 | std::cout << sizeof(cp) << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/container_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/container_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace boost::container; 4 | 5 | struct animal 6 | { 7 | vector children; 8 | }; 9 | 10 | int main() 11 | { 12 | animal parent, child1, child2; 13 | parent.children.push_back(child1); 14 | parent.children.push_back(child2); 15 | } -------------------------------------------------------------------------------- /examples/container_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/container_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::container; 5 | 6 | int main() 7 | { 8 | stable_vector v(2, 1); 9 | int &i = v[1]; 10 | v.erase(v.begin()); 11 | std::cout << i << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/conversion_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : gcc-4.6:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/conversion_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : gcc-4.6:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/coroutine_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_coroutine ..//boost_context ..//boost_system ..//boost_thread : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/coroutine_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::coroutines2; 5 | 6 | void cooperative(coroutine::push_type &sink) 7 | { 8 | std::cout << "Hello"; 9 | sink(); 10 | std::cout << "world"; 11 | } 12 | 13 | int main() 14 | { 15 | coroutine::pull_type source{cooperative}; 16 | std::cout << ", "; 17 | source(); 18 | std::cout << "!\n"; 19 | } 20 | -------------------------------------------------------------------------------- /examples/coroutine_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_coroutine ..//boost_context ..//boost_system ..//boost_thread : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/coroutine_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_coroutine ..//boost_context ..//boost_system ..//boost_thread : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/coroutine_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_coroutine ..//boost_context ..//boost_system ..//boost_thread : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::gregorian::date d{2014, 1, 31}; 7 | std::cout << d.year() << '\n'; 8 | std::cout << d.month() << '\n'; 9 | std::cout << d.day() << '\n'; 10 | std::cout << d.day_of_week() << '\n'; 11 | std::cout << d.end_of_month() << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/datetime_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::gregorian; 5 | 6 | int main() 7 | { 8 | date d1{2014, 1, 31}; 9 | date d2{2014, 2, 28}; 10 | date_duration dd = d2 - d1; 11 | std::cout << dd.days() << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/datetime_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::gregorian; 5 | 6 | int main() 7 | { 8 | date_duration dd{4}; 9 | std::cout << dd.days() << '\n'; 10 | weeks ws{4}; 11 | std::cout << ws.days() << '\n'; 12 | months ms{4}; 13 | std::cout << ms.number_of_months() << '\n'; 14 | years ys{4}; 15 | std::cout << ys.number_of_years() << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/datetime_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::gregorian; 5 | 6 | int main() 7 | { 8 | date d{2014, 1, 31}; 9 | months ms{1}; 10 | date d2 = d + ms; 11 | std::cout << d2 << '\n'; 12 | date d3 = d2 - ms; 13 | std::cout << d3 << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/datetime_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::gregorian; 5 | 6 | int main() 7 | { 8 | date d{2014, 1, 30}; 9 | months ms{1}; 10 | date d2 = d + ms; 11 | std::cout << d2 << '\n'; 12 | date d3 = d2 - ms; 13 | std::cout << d3 << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/datetime_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::gregorian; 5 | 6 | int main() 7 | { 8 | date d1{2014, 1, 1}; 9 | date d2{2014, 2, 28}; 10 | date_period dp{d1, d2}; 11 | date_duration dd = dp.length(); 12 | std::cout << dd.days() << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/datetime_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::gregorian; 5 | 6 | int main() 7 | { 8 | date d1{2014, 1, 1}; 9 | date d2{2014, 2, 28}; 10 | date_period dp{d1, d2}; 11 | std::cout.setf(std::ios::boolalpha); 12 | std::cout << dp.contains(d1) << '\n'; 13 | std::cout << dp.contains(d2) << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/datetime_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_09/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost; 5 | 6 | int main() 7 | { 8 | gregorian::date d{2014, 5, 12}; 9 | gregorian::day_iterator it{d}; 10 | std::cout << *++it << '\n'; 11 | std::cout << date_time::next_weekday(*it, 12 | gregorian::greg_weekday(date_time::Friday)) << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/datetime_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_10/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::posix_time; 6 | using namespace boost::gregorian; 7 | 8 | int main() 9 | { 10 | ptime pt{date{2014, 5, 12}, time_duration{12, 0, 0}}; 11 | date d = pt.date(); 12 | std::cout << d << '\n'; 13 | time_duration td = pt.time_of_day(); 14 | std::cout << td << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/datetime_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_12/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::posix_time; 5 | 6 | int main() 7 | { 8 | time_duration td{16, 30, 0}; 9 | std::cout << td.hours() << '\n'; 10 | std::cout << td.minutes() << '\n'; 11 | std::cout << td.seconds() << '\n'; 12 | std::cout << td.total_seconds() << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/datetime_13/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_14/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_14/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::posix_time; 5 | using namespace boost::gregorian; 6 | 7 | int main() 8 | { 9 | ptime pt1{date{2014, 5, 12}, time_duration{12, 0, 0}}; 10 | time_duration td{6, 30, 0}; 11 | ptime pt2 = pt1 + td; 12 | std::cout << pt2.time_of_day() << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/datetime_15/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_16/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_16/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::posix_time; 5 | using namespace boost::gregorian; 6 | 7 | int main() 8 | { 9 | ptime pt{date{2014, 5, 12}, time_duration{12, 0, 0}}; 10 | time_iterator it{pt, time_duration{6, 30, 0}}; 11 | std::cout << *++it << '\n'; 12 | std::cout << *++it << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/datetime_17/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_18/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_19/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_20/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/datetime_20/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::gregorian; 6 | 7 | int main() 8 | { 9 | date d{2014, 5, 12}; 10 | date_facet *df = new date_facet{"%A, %d %B %Y"}; 11 | std::cout.imbue(std::locale{std::cout.getloc(), df}); 12 | std::cout << d << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/datetime_21/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/dynamicbitset_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/enableif_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/enableif_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/exception_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : msvc-12.0:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/exception_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : msvc-12.0:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/exception_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : msvc-12.0:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace boost::filesystem; 4 | 5 | int main() 6 | { 7 | path p1{"C:\\"}; 8 | path p2{"C:\\Windows"}; 9 | path p3{L"C:\\Boost C++ \u5E93"}; 10 | } -------------------------------------------------------------------------------- /examples/filesystem_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace boost::filesystem; 4 | 5 | int main() 6 | { 7 | path p1{"..."}; 8 | path p2{"\\"}; 9 | path p3{"@:"}; 10 | } -------------------------------------------------------------------------------- /examples/filesystem_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"/"}; 9 | std::cout << p.string() << '\n'; 10 | std::cout << p.generic_string() << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/filesystem_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"C:\\Windows\\System"}; 9 | std::cout << p.root_name() << '\n'; 10 | std::cout << p.root_directory() << '\n'; 11 | std::cout << p.root_path() << '\n'; 12 | std::cout << p.relative_path() << '\n'; 13 | std::cout << p.parent_path() << '\n'; 14 | std::cout << p.filename() << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/filesystem_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"photo.jpg"}; 9 | std::cout << p.stem() << '\n'; 10 | std::cout << p.extension() << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/filesystem_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"C:\\Windows\\System"}; 9 | for (const path &pp : p) 10 | std::cout << pp << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/filesystem_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"C:\\"}; 9 | p /= "Windows\\System"; 10 | std::cout << p.string() << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/filesystem_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_09/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"C:/Windows/System"}; 9 | std::cout << p.make_preferred() << '\n'; 10 | } -------------------------------------------------------------------------------- /examples/filesystem_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_10/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"C:\\"}; 9 | try 10 | { 11 | file_status s = status(p); 12 | std::cout << std::boolalpha << is_directory(s) << '\n'; 13 | } 14 | catch (filesystem_error &e) 15 | { 16 | std::cerr << e.what() << '\n'; 17 | } 18 | } -------------------------------------------------------------------------------- /examples/filesystem_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_11/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"C:\\Windows\\win.ini"}; 9 | boost::system::error_code ec; 10 | boost::uintmax_t filesize = file_size(p, ec); 11 | if (!ec) 12 | std::cout << filesize << '\n'; 13 | else 14 | std::cout << ec << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/filesystem_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_12/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::filesystem; 6 | 7 | int main() 8 | { 9 | path p{"C:\\Windows\\win.ini"}; 10 | try 11 | { 12 | std::time_t t = last_write_time(p); 13 | std::cout << std::ctime(&t) << '\n'; 14 | } 15 | catch (filesystem_error &e) 16 | { 17 | std::cerr << e.what() << '\n'; 18 | } 19 | } -------------------------------------------------------------------------------- /examples/filesystem_13/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_13/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"C:\\"}; 9 | try 10 | { 11 | space_info s = space(p); 12 | std::cout << s.capacity << '\n'; 13 | std::cout << s.free << '\n'; 14 | std::cout << s.available << '\n'; 15 | } 16 | catch (filesystem_error &e) 17 | { 18 | std::cerr << e.what() << '\n'; 19 | } 20 | } -------------------------------------------------------------------------------- /examples/filesystem_14/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_14/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"C:\\Test"}; 9 | try 10 | { 11 | if (create_directory(p)) 12 | { 13 | rename(p, "C:\\Test2"); 14 | boost::filesystem::remove("C:\\Test2"); 15 | } 16 | } 17 | catch (filesystem_error &e) 18 | { 19 | std::cerr << e.what() << '\n'; 20 | } 21 | } -------------------------------------------------------------------------------- /examples/filesystem_15/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_15/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | try 9 | { 10 | std::cout << absolute("photo.jpg") << '\n'; 11 | } 12 | catch (filesystem_error &e) 13 | { 14 | std::cerr << e.what() << '\n'; 15 | } 16 | } -------------------------------------------------------------------------------- /examples/filesystem_16/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_16/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | try 9 | { 10 | std::cout << absolute("photo.jpg", "D:\\") << '\n'; 11 | } 12 | catch (filesystem_error &e) 13 | { 14 | std::cerr << e.what() << '\n'; 15 | } 16 | } -------------------------------------------------------------------------------- /examples/filesystem_17/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_17/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | try 9 | { 10 | std::cout << current_path() << '\n'; 11 | current_path("C:\\"); 12 | std::cout << current_path() << '\n'; 13 | } 14 | catch (filesystem_error &e) 15 | { 16 | std::cerr << e.what() << '\n'; 17 | } 18 | } -------------------------------------------------------------------------------- /examples/filesystem_18/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_18/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p = current_path(); 9 | directory_iterator it{p}; 10 | while (it != directory_iterator{}) 11 | std::cout << *it++ << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/filesystem_19/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_filesystem ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/filesystem_19/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::filesystem; 5 | 6 | int main() 7 | { 8 | path p{"test.txt"}; 9 | ofstream ofs{p}; 10 | ofs << "Hello, world!\n"; 11 | } -------------------------------------------------------------------------------- /examples/flyweight_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/flyweight_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct person 5 | { 6 | int id_; 7 | std::string city_; 8 | }; 9 | 10 | int main() 11 | { 12 | std::vector persons; 13 | for (int i = 0; i < 100000; ++i) 14 | persons.push_back({i, "Berlin"}); 15 | } -------------------------------------------------------------------------------- /examples/flyweight_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/flyweight_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace boost::flyweights; 7 | 8 | struct person 9 | { 10 | int id_; 11 | flyweight city_; 12 | person(int id, std::string city) : id_{id}, city_{std::move(city)} {} 13 | }; 14 | 15 | int main() 16 | { 17 | std::vector persons; 18 | for (int i = 0; i < 100000; ++i) 19 | persons.push_back({i, "Berlin"}); 20 | } -------------------------------------------------------------------------------- /examples/flyweight_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/flyweight_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/flyweight_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/foreach_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/foreach_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::array a{{0, 1, 2, 3}}; 8 | 9 | BOOST_FOREACH(int &i, a) 10 | i *= i; 11 | 12 | BOOST_REVERSE_FOREACH(int i, a) 13 | { 14 | std::cout << i << '\n'; 15 | } 16 | } -------------------------------------------------------------------------------- /examples/format_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/format_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << boost::format{"%1%.%2%.%3%"} % 12 % 5 % 2014 << '\n'; 7 | } -------------------------------------------------------------------------------- /examples/format_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/format_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << boost::format{"%2%/%1%/%3%"} % 12 % 5 % 2014 << '\n'; 7 | } -------------------------------------------------------------------------------- /examples/format_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/format_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << boost::format{"%1% %2% %1%"} % 7 | boost::io::group(std::showpos, 1) % 2 << '\n'; 8 | } -------------------------------------------------------------------------------- /examples/format_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/format_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << boost::format{"%|1$+| %2% %1%"} % 1 % 2 << '\n'; 7 | } -------------------------------------------------------------------------------- /examples/format_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/format_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | try 7 | { 8 | std::cout << boost::format{"%|+| %2% %1%"} % 1 % 2 << '\n'; 9 | } 10 | catch (boost::io::format_error &ex) 11 | { 12 | std::cout << ex.what() << '\n'; 13 | } 14 | } -------------------------------------------------------------------------------- /examples/format_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/format_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << boost::format{"%|+| %|| %||"} % 1 % 2 % 1 << '\n'; 7 | } -------------------------------------------------------------------------------- /examples/format_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/format_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << boost::format{"%+d %d %d"} % 1 % 2 % 1 << '\n'; 7 | } -------------------------------------------------------------------------------- /examples/format_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/format_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << boost::format{"%+s %s %s"} % 1 % 2 % 1 << '\n'; 7 | } -------------------------------------------------------------------------------- /examples/format_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/format_09/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct animal 6 | { 7 | std::string name; 8 | int legs; 9 | }; 10 | 11 | std::ostream &operator<<(std::ostream &os, const animal &a) 12 | { 13 | return os << a.name << ',' << a.legs; 14 | } 15 | 16 | int main() 17 | { 18 | animal a{"cat", 4}; 19 | std::cout << boost::format{"%1%"} % a << '\n'; 20 | } -------------------------------------------------------------------------------- /examples/function_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/function_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | boost::function f = std::atoi; 9 | std::cout << f("42") << '\n'; 10 | f = std::strlen; 11 | std::cout << f("42") << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/function_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/function_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | try 7 | { 8 | boost::function f; 9 | f(""); 10 | } 11 | catch (boost::bad_function_call &ex) 12 | { 13 | std::cerr << ex.what() << '\n'; 14 | } 15 | } -------------------------------------------------------------------------------- /examples/function_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/function_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct world 6 | { 7 | void hello(std::ostream &os) 8 | { 9 | os << "Hello, world!\n"; 10 | } 11 | }; 12 | 13 | int main() 14 | { 15 | boost::function f = &world::hello; 16 | world w; 17 | f(&w, std::ref(std::cout)); 18 | } -------------------------------------------------------------------------------- /examples/fusion_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/fusion_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::fusion; 6 | 7 | int main() 8 | { 9 | typedef tuple tuple_type; 10 | tuple_type t{10, "Boost", true, 3.14}; 11 | std::cout << get<0>(t) << '\n'; 12 | std::cout << get<1>(t) << '\n'; 13 | std::cout << std::boolalpha << get<2>(t) << '\n'; 14 | std::cout << get<3>(t) << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/fusion_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/fusion_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/fusion_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/fusion_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : msvc-12.0:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/fusion_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : msvc-12.0:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/fusion_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/fusion_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/fusion_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace boost::fusion; 8 | 9 | int main() 10 | { 11 | auto p = std::make_pair(10, 3.14); 12 | std::cout << at>(p) << '\n'; 13 | std::cout << back(p) << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/graph_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph : gcc-4.6:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_13/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_14/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_15/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph : no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/graph_16/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_graph ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/heap_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/heap_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::heap; 5 | 6 | int main() 7 | { 8 | priority_queue pq; 9 | pq.push(2); 10 | pq.push(3); 11 | pq.push(1); 12 | 13 | for (int i : pq) 14 | std::cout << i << '\n'; 15 | 16 | priority_queue pq2; 17 | pq2.push(4); 18 | std::cout << std::boolalpha << (pq > pq2) << '\n'; 19 | } -------------------------------------------------------------------------------- /examples/heap_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/heap_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/heap_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::heap; 5 | 6 | int main() 7 | { 8 | binomial_heap bh; 9 | auto handle = bh.push(2); 10 | bh.push(3); 11 | bh.push(1); 12 | 13 | bh.update(handle, 4); 14 | 15 | std::cout << bh.top() << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/integer_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/integer_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/integer_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::intmax_t imax = 1; 7 | std::cout << sizeof(imax) << '\n'; 8 | 9 | std::cout << sizeof(UINT8_C(1)) << '\n'; 10 | 11 | #ifndef BOOST_NO_INT64_T 12 | std::cout << sizeof(INT64_C(1)) << '\n'; 13 | #endif 14 | } -------------------------------------------------------------------------------- /examples/interprocess_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::interprocess; 5 | 6 | int main() 7 | { 8 | shared_memory_object shdmem{open_or_create, "Boost", read_write}; 9 | shdmem.truncate(1024); 10 | std::cout << shdmem.get_name() << '\n'; 11 | offset_t size; 12 | if (shdmem.get_size(size)) 13 | std::cout << size << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/interprocess_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::interprocess; 5 | 6 | int main() 7 | { 8 | bool removed = shared_memory_object::remove("Boost"); 9 | std::cout << std::boolalpha << removed << '\n'; 10 | } -------------------------------------------------------------------------------- /examples/interprocess_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time : no windows:yes ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_13/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_14/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/interprocess_15/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_date_time ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/intrusive_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/intrusive_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/intrusive_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/intrusive_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/intrusive_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/iostreams_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_iostreams ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/iostreams_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::iostreams; 6 | 7 | int main() 8 | { 9 | char buffer[16]; 10 | array_sink sink{buffer}; 11 | stream os{sink}; 12 | os << "Boost" << std::flush; 13 | std::cout.write(buffer, 5); 14 | } -------------------------------------------------------------------------------- /examples/iostreams_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_iostreams ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/iostreams_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_iostreams ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/iostreams_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_iostreams ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/iostreams_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::iostreams; 6 | 7 | int main() 8 | { 9 | file_source f{"main.cpp"}; 10 | if (f.is_open()) 11 | { 12 | stream is{f}; 13 | std::cout << is.rdbuf() << '\n'; 14 | f.close(); 15 | } 16 | } -------------------------------------------------------------------------------- /examples/iostreams_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_iostreams : no windows:yes ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/iostreams_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_iostreams ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/iostreams_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_iostreams ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/iostreams_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib z ; 2 | exe test : main.cpp ..//boost_headers ..//boost_iostreams z : windows:no ; 3 | stage . : test ; 4 | -------------------------------------------------------------------------------- /examples/lambda_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/lambda_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::vector v{1, 3, 2}; 9 | std::for_each(v.begin(), v.end(), 10 | std::cout << boost::lambda::_1 << "\n"); 11 | } -------------------------------------------------------------------------------- /examples/lambda_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/lambda_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | std::vector v{1, 3, 2}; 10 | std::for_each(v.begin(), v.end(), 11 | boost::lambda::if_then(boost::lambda::_1 > 1, 12 | std::cout << boost::lambda::_1 << "\n")); 13 | } -------------------------------------------------------------------------------- /examples/lexical_cast_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/lexical_cast_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string s = boost::lexical_cast(123); 8 | std::cout << s << '\n'; 9 | double d = boost::lexical_cast(s); 10 | std::cout << d << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/lexical_cast_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/lexical_cast_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | try 8 | { 9 | int i = boost::lexical_cast("abc"); 10 | std::cout << i << '\n'; 11 | } 12 | catch (const boost::bad_lexical_cast &e) 13 | { 14 | std::cerr << e.what() << '\n'; 15 | } 16 | } -------------------------------------------------------------------------------- /examples/lockfree_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/lockfree_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/lockfree_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/lockfree_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system ..//boost_filesystem : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system : msvc-12.0:no clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/log_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_log ..//boost_thread ..//boost_system : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/metastatemachine_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/metastatemachine_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/metastatemachine_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/metastatemachine_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/metastatemachine_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/metastatemachine_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/minmax_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/minmax_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | int i = 2; 8 | int j = 1; 9 | 10 | boost::tuples::tuple t = boost::minmax(i, j); 11 | 12 | std::cout << t.get<0>() << '\n'; 13 | std::cout << t.get<1>() << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/minmax_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/minmax_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | typedef std::array array; 9 | array a{{2, 3, 0, 1}}; 10 | 11 | std::pair p = 12 | boost::minmax_element(a.begin(), a.end()); 13 | 14 | std::cout << *p.first << '\n'; 15 | std::cout << *p.second << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/mpi_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | boost::mpi::environment env{argc, argv}; 7 | boost::mpi::communicator world; 8 | std::cout << world.rank() << ", " << world.size() << '\n'; 9 | } -------------------------------------------------------------------------------- /examples/mpi_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | boost::mpi::environment env{argc, argv}; 7 | boost::mpi::communicator world; 8 | if (world.rank() == 0) 9 | { 10 | int i; 11 | world.recv(1, 16, i); 12 | std::cout << i << '\n'; 13 | } 14 | else if (world.rank() == 1) 15 | { 16 | world.send(0, 16, 99); 17 | } 18 | } -------------------------------------------------------------------------------- /examples/mpi_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | boost::mpi::environment env{argc, argv}; 7 | boost::mpi::communicator world; 8 | if (world.rank() == 0) 9 | { 10 | int i; 11 | world.recv(boost::mpi::any_source, 16, i); 12 | std::cout << i << '\n'; 13 | } 14 | else 15 | { 16 | world.send(0, 16, world.rank()); 17 | } 18 | } -------------------------------------------------------------------------------- /examples/mpi_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | boost::mpi::environment env{argc, argv}; 7 | boost::mpi::communicator world; 8 | if (world.rank() == 0) 9 | { 10 | int i; 11 | boost::mpi::status s = world.recv(boost::mpi::any_source, 16, i); 12 | std::cout << s.source() << ": " << i << '\n'; 13 | } 14 | else 15 | { 16 | world.send(0, 16, 99); 17 | } 18 | } -------------------------------------------------------------------------------- /examples/mpi_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_12/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | boost::mpi::environment env{argc, argv}; 9 | boost::mpi::communicator world; 10 | std::string s; 11 | if (world.rank() == 0) 12 | s = "Hello, world!"; 13 | boost::mpi::broadcast(world, s, 0); 14 | std::cout << s << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/mpi_13/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_14/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_15/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/mpi_16/Jamfile.jam: -------------------------------------------------------------------------------- 1 | searched-lib mpi : : mpich : : linux:/usr/include/mpi ; 2 | searched-lib mpl ; 3 | searched-lib cr : : shared ; 4 | exe test : main.cpp ..//boost_headers ..//boost_mpi ..//boost_serialization mpi mpl cr : windows:no cygwin:no ; 5 | stage . : test ; 6 | -------------------------------------------------------------------------------- /examples/multiarray_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/multiarray_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::multi_array a{boost::extents[6]}; 7 | 8 | a[0] = 'B'; 9 | a[1] = 'o'; 10 | a[2] = 'o'; 11 | a[3] = 's'; 12 | a[4] = 't'; 13 | a[5] = '\0'; 14 | 15 | std::cout << a.origin() << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/multiarray_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : msvc-12.0:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/multiarray_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : msvc-12.0:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/multiindex_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/multiindex_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/multiindex_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/multiindex_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/multiindex_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/numeric_conversion_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/numeric_conversion_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int i = 0x10000; 6 | short s = i; 7 | std::cout << s << '\n'; 8 | } -------------------------------------------------------------------------------- /examples/numeric_conversion_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/numeric_conversion_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | try 7 | { 8 | int i = 0x10000; 9 | short s = boost::numeric_cast(i); 10 | std::cout << s << '\n'; 11 | } 12 | catch (boost::numeric::bad_numeric_cast &e) 13 | { 14 | std::cerr << e.what() << '\n'; 15 | } 16 | } -------------------------------------------------------------------------------- /examples/numeric_conversion_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/numeric_conversion_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | try 7 | { 8 | int i = -0x10000; 9 | short s = boost::numeric_cast(i); 10 | std::cout << s << '\n'; 11 | } 12 | catch (boost::numeric::negative_overflow &e) 13 | { 14 | std::cerr << e.what() << '\n'; 15 | } 16 | } -------------------------------------------------------------------------------- /examples/operators_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/optional_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/optional_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int get_even_random_number() 7 | { 8 | int i = std::rand(); 9 | return (i % 2 == 0) ? i : -1; 10 | } 11 | 12 | int main() 13 | { 14 | std::srand(static_cast(std::time(0))); 15 | int i = get_even_random_number(); 16 | if (i != -1) 17 | std::cout << std::sqrt(static_cast(i)) << '\n'; 18 | } -------------------------------------------------------------------------------- /examples/optional_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/optional_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/optional_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/parameter_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/parameter_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/parameter_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/parameter_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::vector v{1, 2, 3, 4, 5}; 9 | 10 | using namespace boost::phoenix::placeholders; 11 | auto phoenix = arg1 > 2 && arg1 % 2 == 1; 12 | std::cout << std::count_if(v.begin(), v.end(), phoenix) << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/phoenix_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::vector v{1, 2, 3, 4, 5}; 9 | 10 | using namespace boost::phoenix; 11 | using namespace boost::phoenix::placeholders; 12 | auto phoenix = arg1 > val(2) && arg1 % val(2) == val(1); 13 | std::cout << std::count_if(v.begin(), v.end(), phoenix) << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/phoenix_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | using namespace boost::phoenix::placeholders; 7 | std::cout << arg1(1, 2, 3, 4, 5) << '\n'; 8 | 9 | auto v = boost::phoenix::val(2); 10 | std::cout << v() << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/phoenix_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | bool is_odd_function(int i) { return i % 2 == 1; } 7 | 8 | BOOST_PHOENIX_ADAPT_FUNCTION(bool, is_odd, is_odd_function, 1) 9 | 10 | int main() 11 | { 12 | std::vector v{1, 2, 3, 4, 5}; 13 | 14 | using namespace boost::phoenix::placeholders; 15 | std::cout << std::count_if(v.begin(), v.end(), is_odd(arg1)) << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/phoenix_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | bool is_odd(int i) { return i % 2 == 1; } 7 | 8 | int main() 9 | { 10 | std::vector v{1, 2, 3, 4, 5}; 11 | 12 | using namespace boost::phoenix; 13 | using namespace boost::phoenix::placeholders; 14 | std::cout << std::count_if(v.begin(), v.end(), bind(is_odd, arg1)) << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/phoenix_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/phoenix_09/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::vector v{1, 2, 3, 4, 5}; 9 | 10 | using namespace boost::phoenix; 11 | using namespace boost::phoenix::placeholders; 12 | int count = 0; 13 | std::for_each(v.begin(), v.end(), if_(arg1 > 2 && arg1 % 2 == 1) 14 | [ 15 | ++ref(count) 16 | ]); 17 | std::cout << count << '\n'; 18 | } -------------------------------------------------------------------------------- /examples/pool_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/pool_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/pool_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | boost::object_pool pool; 6 | 7 | int *i = pool.malloc(); 8 | *i = 1; 9 | 10 | int *j = pool.construct(2); 11 | 12 | pool.destroy(i); 13 | pool.destroy(j); 14 | } -------------------------------------------------------------------------------- /examples/pool_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/pool_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::object_pool pool{32, 0}; 7 | pool.construct(); 8 | std::cout << pool.get_next_size() << '\n'; 9 | pool.set_next_size(8); 10 | } -------------------------------------------------------------------------------- /examples/pool_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/pool_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct int_pool {}; 4 | typedef boost::singleton_pool singleton_int_pool; 5 | 6 | int main() 7 | { 8 | int *i = static_cast(singleton_int_pool::malloc()); 9 | *i = 1; 10 | 11 | int *j = static_cast(singleton_int_pool::ordered_malloc(10)); 12 | j[9] = 2; 13 | 14 | singleton_int_pool::release_memory(); 15 | singleton_int_pool::purge_memory(); 16 | } -------------------------------------------------------------------------------- /examples/pool_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/pool_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::vector> v; 7 | for (int i = 0; i < 1000; ++i) 8 | v.push_back(i); 9 | 10 | v.clear(); 11 | boost::singleton_pool:: 12 | purge_memory(); 13 | } -------------------------------------------------------------------------------- /examples/pool_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/program_options_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_program_options ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/program_options_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_program_options ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/program_options_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_program_options ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/program_options_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_program_options ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/program_options_04/config.txt: -------------------------------------------------------------------------------- 1 | age=29 -------------------------------------------------------------------------------- /examples/propertytree_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/propertytree_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using boost::property_tree::ptree; 5 | 6 | int main() 7 | { 8 | ptree pt; 9 | pt.put("C:.Windows.System", "20 files"); 10 | 11 | ptree &c = pt.get_child("C:"); 12 | ptree &windows = c.get_child("Windows"); 13 | ptree &system = windows.get_child("System"); 14 | std::cout << system.get_value() << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/propertytree_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/propertytree_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/propertytree_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/propertytree_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/ptr_container_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/ptr_container_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::ptr_vector v; 7 | v.push_back(new int{1}); 8 | v.push_back(new int{2}); 9 | std::cout << v.back() << '\n'; 10 | } -------------------------------------------------------------------------------- /examples/ptr_container_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/ptr_container_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/ptr_container_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | boost::ptr_vector v; 10 | std::array a{{0, 1, 2}}; 11 | std::copy(a.begin(), a.end(), boost::ptr_container::ptr_back_inserter(v)); 12 | std::cout << v.size() << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/random_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_random ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/random_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::time_t now = std::time(0); 9 | boost::random::mt19937 gen{static_cast(now)}; 10 | std::cout << gen() << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/random_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_random ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/random_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::random::random_device gen; 7 | std::cout << gen() << '\n'; 8 | } -------------------------------------------------------------------------------- /examples/random_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_random ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/random_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::time_t now = std::time(0); 9 | boost::random::mt19937 gen{static_cast(now)}; 10 | boost::random::bernoulli_distribution<> dist; 11 | std::cout << dist(gen) << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/random_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_random ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/random_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::time_t now = std::time(0); 9 | boost::random::mt19937 gen{static_cast(now)}; 10 | boost::random::uniform_int_distribution<> dist{1, 100}; 11 | std::cout << dist(gen) << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/range_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/range_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::array a{{0, 1, 0, 1, 0, 1}}; 8 | std::cout << boost::count(a, 0) << '\n'; 9 | } -------------------------------------------------------------------------------- /examples/range_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/range_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | std::array a{{0, 1, 2, 3, 4, 5}}; 10 | boost::random_shuffle(a); 11 | boost::copy(a, std::ostream_iterator{std::cout, ","}); 12 | std::cout << "\n" << *boost::max_element(a) << '\n'; 13 | std::cout << boost::accumulate(a, 0) << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/range_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/range_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | std::array a{{0, 1, 2, 3, 4, 5}}; 10 | std::cout << std::boolalpha << boost::is_sorted(a) << '\n'; 11 | std::deque d; 12 | boost::push_back(d, a); 13 | boost::remove_erase(d, 2); 14 | boost::copy_n(d, 3, std::ostream_iterator{std::cout, ","}); 15 | } -------------------------------------------------------------------------------- /examples/range_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/range_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | std::array a{{0, 5, 2, 1, 3, 4}}; 10 | boost::copy(boost::adaptors::filter(a, [](int i){ return i > 2; }), 11 | std::ostream_iterator{std::cout, ","}); 12 | } -------------------------------------------------------------------------------- /examples/range_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/range_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/range_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | std::string s = "The Boost C++ Libraries"; 10 | boost::regex expr{"[\\w+]+"}; 11 | boost::copy(boost::adaptors::tokenize(s, expr, 0, 12 | boost::regex_constants::match_default), 13 | std::ostream_iterator{std::cout, ","}); 14 | } -------------------------------------------------------------------------------- /examples/range_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/range_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | boost::integer_range ir = boost::irange(0, 3); 8 | boost::copy(ir, std::ostream_iterator{std::cout, ","}); 9 | } -------------------------------------------------------------------------------- /examples/range_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/range_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | boost::iterator_range> ir = 9 | boost::istream_range(std::cin); 10 | boost::copy(ir, std::ostream_iterator{std::cout, "\n"}); 11 | } -------------------------------------------------------------------------------- /examples/range_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/ref_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/ref_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | void print(std::ostream &os, int i) 8 | { 9 | os << i << std::endl; 10 | } 11 | 12 | int main() 13 | { 14 | std::vector v{1, 3, 2}; 15 | std::for_each(v.begin(), v.end(), 16 | std::bind(print, boost::ref(std::cout), std::placeholders::_1)); 17 | } -------------------------------------------------------------------------------- /examples/regex_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/regex_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string s = "Boost Libraries"; 8 | boost::regex expr{"\\w+\\s\\w+"}; 9 | std::cout << std::boolalpha << boost::regex_match(s, expr) << '\n'; 10 | } -------------------------------------------------------------------------------- /examples/regex_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/regex_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string s = "Boost Libraries"; 8 | boost::regex expr{"(\\w+)\\s(\\w+)"}; 9 | boost::smatch what; 10 | if (boost::regex_search(s, what, expr)) 11 | { 12 | std::cout << what[0] << '\n'; 13 | std::cout << what[1] << "_" << what[2] << '\n'; 14 | } 15 | } -------------------------------------------------------------------------------- /examples/regex_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/regex_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string s = " Boost Libraries "; 8 | boost::regex expr{"\\s"}; 9 | std::string fmt{"_"}; 10 | std::cout << boost::regex_replace(s, expr, fmt) << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/regex_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/regex_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string s = "Boost Libraries"; 8 | boost::regex expr{"(\\w+)\\s(\\w+)"}; 9 | std::string fmt{"\\2 \\1"}; 10 | std::cout << boost::regex_replace(s, expr, fmt) << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/regex_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/regex_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string s = "Boost Libraries"; 8 | boost::regex expr{"(\\w+)\\s(\\w+)"}; 9 | std::string fmt{"\\2 \\1"}; 10 | std::cout << boost::regex_replace(s, expr, fmt, 11 | boost::regex_constants::format_literal) << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/regex_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/regex_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string s = "Boost Libraries"; 8 | boost::regex expr{"\\w+"}; 9 | boost::regex_token_iterator it{s.begin(), s.end(), 10 | expr}; 11 | boost::regex_token_iterator end; 12 | while (it != end) 13 | std::cout << *it++ << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/regex_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/regex_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string s = "Boost Libraries"; 8 | boost::regex expr{"(\\w)\\w+"}; 9 | boost::regex_token_iterator it{s.begin(), s.end(), 10 | expr, 1}; 11 | boost::regex_token_iterator end; 12 | while (it != end) 13 | std::cout << *it++ << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/regex_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/regex_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::string s = "Boost k\xfct\xfcphaneleri"; 9 | boost::basic_regex> expr; 10 | expr.imbue(std::locale{"Turkish"}); 11 | expr = "\\w+\\s\\w+"; 12 | std::cout << std::boolalpha << boost::regex_match(s, expr) << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/scopeexit_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/scopeexit_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int *foo() 5 | { 6 | int *i = new int{10}; 7 | BOOST_SCOPE_EXIT(&i) 8 | { 9 | delete i; 10 | i = 0; 11 | } BOOST_SCOPE_EXIT_END 12 | std::cout << *i << '\n'; 13 | return i; 14 | } 15 | 16 | int main() 17 | { 18 | int *j = foo(); 19 | std::cout << j << '\n'; 20 | } -------------------------------------------------------------------------------- /examples/scopeexit_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/scopeexit_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::archive; 5 | 6 | int main() 7 | { 8 | text_oarchive oa{std::cout}; 9 | int i = 1; 10 | oa << i; 11 | } -------------------------------------------------------------------------------- /examples/serialization_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization : gcc-4.6:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_13/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization : gcc-4.6:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_14/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/serialization_15/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_serialization ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::signals2; 5 | 6 | int main() 7 | { 8 | signal s; 9 | s.connect([]{ std::cout << "Hello, world!\n"; }); 10 | s(); 11 | } -------------------------------------------------------------------------------- /examples/signals2_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::function f; 7 | f = []{ std::cout << "Hello, world!\n"; }; 8 | f(); 9 | } -------------------------------------------------------------------------------- /examples/signals2_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::signals2; 5 | 6 | int main() 7 | { 8 | signal s; 9 | s.connect([]{ std::cout << "Hello"; }); 10 | s.connect([]{ std::cout << ", world!\n"; }); 11 | s(); 12 | } -------------------------------------------------------------------------------- /examples/signals2_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::signals2; 5 | 6 | int main() 7 | { 8 | signal s; 9 | s.connect(1, []{ std::cout << ", world!\n"; }); 10 | s.connect(0, []{ std::cout << "Hello"; }); 11 | s(); 12 | } -------------------------------------------------------------------------------- /examples/signals2_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::signals2; 5 | 6 | void hello() { std::cout << "Hello"; } 7 | void world() { std::cout << ", world!\n"; } 8 | 9 | int main() 10 | { 11 | signal s; 12 | s.connect(hello); 13 | s.connect(world); 14 | s.disconnect(world); 15 | s(); 16 | } -------------------------------------------------------------------------------- /examples/signals2_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::signals2; 5 | 6 | int main() 7 | { 8 | signal s; 9 | s.connect([]{ std::cout << "Hello"; }); 10 | s.connect([]{ std::cout << ", world!"; }); 11 | std::cout << s.num_slots() << '\n'; 12 | if (!s.empty()) 13 | s(); 14 | s.disconnect_all_slots(); 15 | } -------------------------------------------------------------------------------- /examples/signals2_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::signals2; 5 | 6 | int main() 7 | { 8 | signal s; 9 | s.connect([]{ return 1; }); 10 | s.connect([]{ return 2; }); 11 | std::cout << *s() << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/signals2_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_10/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::signals2::signal s; 7 | boost::signals2::connection c = s.connect( 8 | []{ std::cout << "Hello, world!\n"; }); 9 | s(); 10 | c.disconnect(); 11 | } -------------------------------------------------------------------------------- /examples/signals2_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_11/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::signals2; 5 | 6 | int main() 7 | { 8 | signal s; 9 | connection c = s.connect([]{ std::cout << "Hello, world!\n"; }); 10 | s(); 11 | shared_connection_block b{c}; 12 | s(); 13 | b.unblock(); 14 | s(); 15 | } -------------------------------------------------------------------------------- /examples/signals2_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_12/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::signals2; 5 | 6 | int main() 7 | { 8 | signal s; 9 | connection c = s.connect([]{ std::cout << "Hello, world!\n"; }); 10 | shared_connection_block b1{c, false}; 11 | { 12 | shared_connection_block b2{c}; 13 | std::cout << std::boolalpha << b1.blocking() << '\n'; 14 | s(); 15 | } 16 | s(); 17 | } -------------------------------------------------------------------------------- /examples/signals2_13/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_14/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_15/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_15/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | boost::signals2::signal s; 5 | 6 | void connect() 7 | { 8 | s.connect([]{ std::cout << "Hello, world!\n"; }); 9 | } 10 | 11 | int main() 12 | { 13 | s.connect(connect); 14 | s(); 15 | } -------------------------------------------------------------------------------- /examples/signals2_16/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_16/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | boost::signals2::signal s; 5 | 6 | void hello() 7 | { 8 | std::cout << "Hello, world!\n"; 9 | } 10 | 11 | void disconnect() 12 | { 13 | s.disconnect(hello); 14 | } 15 | 16 | int main() 17 | { 18 | s.connect(disconnect); 19 | s.connect(hello); 20 | s(); 21 | } -------------------------------------------------------------------------------- /examples/signals2_17/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_18/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : cygwin:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/signals2_18/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::signals2; 5 | 6 | signal s; 7 | 8 | int main() 9 | { 10 | typedef keywords::mutex_type dummy_mutex; 11 | signal_type::type s; 12 | s.connect([]{ std::cout << "Hello, world!\n"; }); 13 | s(); 14 | } -------------------------------------------------------------------------------- /examples/smartpointers_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/smartpointers_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::scoped_ptr p{new int{1}}; 7 | std::cout << *p << '\n'; 8 | p.reset(new int{2}); 9 | std::cout << *p.get() << '\n'; 10 | p.reset(); 11 | std::cout << std::boolalpha << static_cast(p) << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/smartpointers_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/smartpointers_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | boost::scoped_array p{new int[2]}; 6 | *p.get() = 1; 7 | p[1] = 2; 8 | p.reset(new int[3]); 9 | } -------------------------------------------------------------------------------- /examples/smartpointers_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/smartpointers_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::shared_ptr p1{new int{1}}; 7 | std::cout << *p1 << '\n'; 8 | boost::shared_ptr p2{p1}; 9 | p1.reset(new int{2}); 10 | std::cout << *p1.get() << '\n'; 11 | p1.reset(); 12 | std::cout << std::boolalpha << static_cast(p2) << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/smartpointers_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : no windows:yes ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/smartpointers_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::shared_ptr handle(OpenProcess(PROCESS_SET_INFORMATION, FALSE, 7 | GetCurrentProcessId()), CloseHandle); 8 | } -------------------------------------------------------------------------------- /examples/smartpointers_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/smartpointers_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | auto p1 = boost::make_shared(1); 8 | std::cout << typeid(p1).name() << '\n'; 9 | auto p2 = boost::make_shared(10); 10 | std::cout << typeid(p2).name() << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/smartpointers_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/smartpointers_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::shared_array p1{new int[1]}; 7 | { 8 | boost::shared_array p2{p1}; 9 | p2[0] = 1; 10 | } 11 | std::cout << p1[0] << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/smartpointers_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/smartpointers_07/main.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_SP_USE_QUICK_ALLOCATOR 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | boost::shared_ptr p; 9 | std::time_t then = std::time(nullptr); 10 | for (int i = 0; i < 1000000; ++i) 11 | p.reset(new int{i}); 12 | std::time_t now = std::time(nullptr); 13 | std::cout << now - then << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/smartpointers_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : clang-3.3:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/smartpointers_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers : no windows:yes ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::spirit; 6 | 7 | int main() 8 | { 9 | std::string s; 10 | std::getline(std::cin, s); 11 | auto it = s.begin(); 12 | bool match = qi::parse(it, s.end(), ascii::digit); 13 | std::cout << std::boolalpha << match << '\n'; 14 | if (it != s.end()) 15 | std::cout << std::string{it, s.end()} << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/spirit_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::spirit; 6 | 7 | int main() 8 | { 9 | std::string s; 10 | std::getline(std::cin, s); 11 | auto it = s.begin(); 12 | bool match = qi::phrase_parse(it, s.end(), ascii::digit, ascii::space); 13 | std::cout << std::boolalpha << match << '\n'; 14 | if (it != s.end()) 15 | std::cout << std::string{it, s.end()} << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/spirit_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::spirit; 6 | 7 | int main() 8 | { 9 | std::string s; 10 | std::getline(std::cin, s); 11 | auto it = s.begin(); 12 | bool match = qi::phrase_parse(it, s.end(), +ascii::digit, ascii::space); 13 | std::cout << std::boolalpha << match << '\n'; 14 | if (it != s.end()) 15 | std::cout << std::string{it, s.end()} << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/spirit_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::spirit; 6 | 7 | int main() 8 | { 9 | std::string s; 10 | std::getline(std::cin, s); 11 | auto it = s.begin(); 12 | bool match = qi::phrase_parse(it, s.end(), qi::int_, ascii::space); 13 | std::cout << std::boolalpha << match << '\n'; 14 | if (it != s.end()) 15 | std::cout << std::string{it, s.end()} << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/spirit_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_11/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::spirit; 6 | 7 | int main() 8 | { 9 | std::string s; 10 | std::getline(std::cin, s); 11 | auto it = s.begin(); 12 | int i; 13 | if (qi::phrase_parse(it, s.end(), qi::int_, ascii::space, i)) 14 | std::cout << i << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/spirit_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_13/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_14/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_15/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/spirit_16/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::algorithm; 6 | 7 | int main() 8 | { 9 | std::string s = "Boost C++ Libraries"; 10 | std::cout << to_upper_copy(s) << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/stringalgorithms_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::algorithm; 6 | 7 | int main() 8 | { 9 | std::string s = "Boost C++ Libraries"; 10 | boost::iterator_range r = find_first(s, "C++"); 11 | std::cout << r << '\n'; 12 | r = find_first(s, "xyz"); 13 | std::cout << r << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/stringalgorithms_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace boost::algorithm; 7 | 8 | int main() 9 | { 10 | std::vector v{"Boost", "C++", "Libraries"}; 11 | std::cout << join(v, " ") << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/stringalgorithms_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::algorithm; 6 | 7 | int main() 8 | { 9 | std::string s = "\t Boost C++ Libraries \t"; 10 | std::cout << "_" << trim_left_copy(s) << "_\n"; 11 | std::cout << "_" << trim_right_copy(s) << "_\n"; 12 | std::cout << "_" << trim_copy(s) << "_\n"; 13 | } -------------------------------------------------------------------------------- /examples/stringalgorithms_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::algorithm; 6 | 7 | int main() 8 | { 9 | std::string s = "--Boost C++ Libraries--"; 10 | std::cout << trim_left_copy_if(s, is_any_of("-")) << '\n'; 11 | std::cout << trim_right_copy_if(s, is_any_of("-")) << '\n'; 12 | std::cout << trim_copy_if(s, is_any_of("-")) << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/stringalgorithms_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_09/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::algorithm; 6 | 7 | int main() 8 | { 9 | std::string s = "123456789Boost C++ Libraries123456789"; 10 | std::cout << trim_left_copy_if(s, is_digit()) << '\n'; 11 | std::cout << trim_right_copy_if(s, is_digit()) << '\n'; 12 | std::cout << trim_copy_if(s, is_digit()) << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/stringalgorithms_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_11/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace boost::algorithm; 7 | 8 | int main() 9 | { 10 | std::string s = "Boost C++ Libraries"; 11 | std::vector v; 12 | split(v, s, is_space()); 13 | std::cout << v.size() << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/stringalgorithms_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_regex ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/stringalgorithms_12/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace boost::algorithm; 7 | 8 | int main() 9 | { 10 | std::string s = "Boost C++ Libraries"; 11 | boost::iterator_range r = 12 | find_regex(s, boost::regex{"\\w\\+\\+"}); 13 | std::cout << r << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/swap_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/swap_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | char c1 = 'a'; 8 | char c2 = 'b'; 9 | 10 | boost::swap(c1, c2); 11 | 12 | std::cout << c1 << c2 << '\n'; 13 | 14 | boost::array a1{{1}}; 15 | boost::array a2{{2}}; 16 | 17 | boost::swap(a1, a2); 18 | 19 | std::cout << a1[0] << a2[0] << '\n'; 20 | } -------------------------------------------------------------------------------- /examples/system_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/system_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::system; 5 | 6 | void fail(error_code &ec) 7 | { 8 | ec = errc::make_error_code(errc::not_supported); 9 | } 10 | 11 | int main() 12 | { 13 | error_code ec; 14 | fail(ec); 15 | std::cout << ec.value() << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/system_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/system_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::system; 5 | 6 | void fail(error_code &ec) 7 | { 8 | ec = errc::make_error_code(errc::not_supported); 9 | } 10 | 11 | int main() 12 | { 13 | error_code ec; 14 | fail(ec); 15 | std::cout << ec.value() << '\n'; 16 | std::cout << ec.category().name() << '\n'; 17 | } -------------------------------------------------------------------------------- /examples/system_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system : msvc-12.0:no ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/system_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/system_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::system; 5 | 6 | void fail(error_code &ec) 7 | { 8 | ec = errc::make_error_code(errc::not_supported); 9 | } 10 | 11 | int main() 12 | { 13 | error_code ec; 14 | fail(ec); 15 | boost::system::error_condition ecnd = ec.default_error_condition(); 16 | std::cout << ecnd.value() << '\n'; 17 | std::cout << ecnd.category().name() << '\n'; 18 | } -------------------------------------------------------------------------------- /examples/system_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void wait(int seconds) 6 | { 7 | boost::this_thread::sleep_for(boost::chrono::seconds{seconds}); 8 | } 9 | 10 | void thread() 11 | { 12 | for (int i = 0; i < 5; ++i) 13 | { 14 | wait(1); 15 | std::cout << i << '\n'; 16 | } 17 | } 18 | 19 | int main() 20 | { 21 | boost::thread t{thread}; 22 | t.join(); 23 | } -------------------------------------------------------------------------------- /examples/thread_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << boost::this_thread::get_id() << '\n'; 7 | std::cout << boost::thread::hardware_concurrency() << '\n'; 8 | } -------------------------------------------------------------------------------- /examples/thread_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ..//boost_chrono ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ..//boost_chrono ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_11/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_12/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_13/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_14/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_15/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_16/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_thread ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/thread_16/main.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_THREAD_PROVIDES_FUTURE 2 | #include 3 | #include 4 | #include 5 | 6 | int accumulate() 7 | { 8 | int sum = 0; 9 | for (int i = 0; i < 5; ++i) 10 | sum += i; 11 | return sum; 12 | } 13 | 14 | int main() 15 | { 16 | boost::future f = boost::async(accumulate); 17 | std::cout << f.get() << '\n'; 18 | } -------------------------------------------------------------------------------- /examples/timer_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_timer ..//boost_chrono ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/timer_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::timer; 6 | 7 | int main() 8 | { 9 | cpu_timer timer; 10 | 11 | for (int i = 0; i < 1000000; ++i) 12 | std::pow(1.234, i); 13 | std::cout << timer.format() << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/timer_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_timer ..//boost_chrono ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/timer_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_timer ..//boost_chrono ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/timer_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::timer; 6 | 7 | int main() 8 | { 9 | cpu_timer timer; 10 | 11 | for (int i = 0; i < 1000000; ++i) 12 | std::pow(1.234, i); 13 | 14 | cpu_times times = timer.elapsed(); 15 | std::cout << times.wall << '\n'; 16 | std::cout << times.user << '\n'; 17 | std::cout << times.system << '\n'; 18 | } -------------------------------------------------------------------------------- /examples/timer_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ..//boost_chrono ..//boost_timer ..//boost_system ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/timer_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::timer; 5 | 6 | int main() 7 | { 8 | auto_cpu_timer timer; 9 | 10 | for (int i = 0; i < 1000000; ++i) 11 | std::pow(1.234, i); 12 | } -------------------------------------------------------------------------------- /examples/tokenizer_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tokenizer_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::tokenizer> tokenizer; 8 | std::string s = "Boost C++ Libraries"; 9 | tokenizer tok{s}; 10 | for (tokenizer::iterator it = tok.begin(); it != tok.end(); ++it) 11 | std::cout << *it << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/tokenizer_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tokenizer_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::tokenizer> tokenizer; 8 | std::string s = "Boost C++ Libraries"; 9 | boost::char_separator sep{" "}; 10 | tokenizer tok{s, sep}; 11 | for (const auto &t : tok) 12 | std::cout << t << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/tokenizer_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tokenizer_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::tokenizer> tokenizer; 8 | std::string s = "Boost C++ Libraries"; 9 | boost::char_separator sep{" ", "+"}; 10 | tokenizer tok{s, sep}; 11 | for (const auto &t : tok) 12 | std::cout << t << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/tokenizer_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tokenizer_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::tokenizer> tokenizer; 8 | std::string s = "Boost C++ Libraries"; 9 | boost::char_separator sep{" ", "+", boost::keep_empty_tokens}; 10 | tokenizer tok{s, sep}; 11 | for (const auto &t : tok) 12 | std::cout << t << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/tokenizer_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tokenizer_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::tokenizer, 8 | std::wstring::const_iterator, std::wstring> tokenizer; 9 | std::wstring s = L"Boost C++ Libraries"; 10 | boost::char_separator sep{L" "}; 11 | tokenizer tok{s, sep}; 12 | for (const auto &t : tok) 13 | std::wcout << t << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/tokenizer_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tokenizer_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::tokenizer> tokenizer; 8 | std::string s = "Boost,\"C++ Libraries\""; 9 | tokenizer tok{s}; 10 | for (const auto &t : tok) 11 | std::cout << t << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/tokenizer_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tokenizer_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::tokenizer tokenizer; 8 | std::string s = "Boost_C++_Libraries"; 9 | int offsets[] = {5, 5, 9}; 10 | boost::offset_separator sep{offsets, offsets + 3}; 11 | tokenizer tok{s, sep}; 12 | for (const auto &t : tok) 13 | std::cout << t << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/tribool_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tribool_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::logic; 5 | 6 | int main() 7 | { 8 | tribool b; 9 | std::cout << std::boolalpha << b << '\n'; 10 | 11 | b = true; 12 | b = false; 13 | b = indeterminate; 14 | if (b) 15 | ; 16 | else if (!b) 17 | ; 18 | else 19 | std::cout << "indeterminate\n"; 20 | } -------------------------------------------------------------------------------- /examples/tribool_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | typedef boost::tuple animal; 9 | animal a{"cat", 4}; 10 | std::cout << a << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/tuple_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | typedef boost::tuple animal; 9 | animal a{"cat", 4, true}; 10 | std::cout << std::boolalpha << a << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/tuple_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::cout.setf(std::ios::boolalpha); 8 | std::cout << boost::make_tuple("cat", 4, true) << '\n'; 9 | } -------------------------------------------------------------------------------- /examples/tuple_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_04/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | std::string s = "cat"; 10 | std::cout.setf(std::ios::boolalpha); 11 | std::cout << boost::make_tuple(boost::ref(s), 4, true) << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/tuple_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | typedef boost::tuple animal; 8 | animal a = boost::make_tuple("cat", 4, true); 9 | std::cout << a.get<0>() << '\n'; 10 | std::cout << boost::get<0>(a) << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/tuple_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | typedef boost::tuple animal; 9 | animal a = boost::make_tuple("cat", 4, true); 10 | a.get<0>() = "dog"; 11 | std::cout << std::boolalpha << a << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/tuple_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | typedef boost::tuple animal; 9 | animal a1 = boost::make_tuple("cat", 4, true); 10 | animal a2 = boost::make_tuple("shark", 0, true); 11 | std::cout << std::boolalpha << (a1 != a2) << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/tuple_08/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_08/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | typedef boost::tuple animal; 9 | std::string name = "cat"; 10 | int legs = 4; 11 | bool tail = true; 12 | animal a = boost::tie(name, legs, tail); 13 | name = "dog"; 14 | std::cout << std::boolalpha << a << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/tuple_09/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_09/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | typedef boost::tuple animal; 9 | std::string name = "cat"; 10 | int legs = 4; 11 | bool tail = true; 12 | animal a = boost::make_tuple(boost::ref(name), boost::ref(legs), 13 | boost::ref(tail)); 14 | name = "dog"; 15 | std::cout << std::boolalpha << a << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/tuple_10/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/tuple_10/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | boost::tuple new_cat() 6 | { 7 | return boost::make_tuple("cat", 4); 8 | } 9 | 10 | int main() 11 | { 12 | std::string name; 13 | int legs; 14 | boost::tie(name, legs) = new_cat(); 15 | std::cout << name << ", " << legs << '\n'; 16 | } -------------------------------------------------------------------------------- /examples/typetraits_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/typetraits_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost; 5 | 6 | int main() 7 | { 8 | std::cout.setf(std::ios::boolalpha); 9 | std::cout << is_integral::value << '\n'; 10 | std::cout << is_floating_point::value << '\n'; 11 | std::cout << is_arithmetic::value << '\n'; 12 | std::cout << is_reference::value << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/typetraits_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/typetraits_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/typetraits_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost; 5 | 6 | int main() 7 | { 8 | std::cout.setf(std::ios::boolalpha); 9 | std::cout << has_plus::value << '\n'; 10 | std::cout << has_pre_increment::value << '\n'; 11 | std::cout << has_trivial_copy::value << '\n'; 12 | std::cout << has_virtual_destructor::value << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/typetraits_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/unordered_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/unordered_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/unordered_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/utility_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/utility_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/utility_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | const char *funcname = BOOST_CURRENT_FUNCTION; 7 | std::cout << funcname << '\n'; 8 | } -------------------------------------------------------------------------------- /examples/utility_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/utility_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::array a{{'a', 'c', 'b', 'd'}}; 9 | 10 | auto it = std::find(a.begin(), a.end(), 'b'); 11 | auto prior = boost::prior(it, 2); 12 | auto next = boost::next(it); 13 | 14 | std::cout << *prior << '\n'; 15 | std::cout << *it << '\n'; 16 | std::cout << *next << '\n'; 17 | } -------------------------------------------------------------------------------- /examples/utility_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/utility_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/utility_05/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct animal 6 | { 7 | std::string name; 8 | int legs; 9 | 10 | int operator&() const { return legs; } 11 | }; 12 | 13 | int main() 14 | { 15 | animal a{"cat", 4}; 16 | std::cout << &a << '\n'; 17 | std::cout << boost::addressof(a) << '\n'; 18 | } -------------------------------------------------------------------------------- /examples/utility_06/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/utility_06/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int i = BOOST_BINARY(1001 0001); 7 | std::cout << i << '\n'; 8 | 9 | short s = BOOST_BINARY(1000 0000 0000 0000); 10 | std::cout << s << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/utility_07/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/utility_07/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | boost::string_ref start_at_boost(boost::string_ref s) 5 | { 6 | auto idx = s.find("Boost"); 7 | return (idx != boost::string_ref::npos) ? s.substr(idx) : ""; 8 | } 9 | 10 | int main() 11 | { 12 | boost::string_ref s = "The Boost C++ Libraries"; 13 | std::cout << start_at_boost(s) << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/uuid_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/uuid_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace boost::uuids; 7 | 8 | int main() 9 | { 10 | random_generator gen; 11 | uuid id = gen(); 12 | std::cout << id << '\n'; 13 | } -------------------------------------------------------------------------------- /examples/uuid_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/uuid_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::uuids; 6 | 7 | int main() 8 | { 9 | random_generator gen; 10 | uuid id = gen(); 11 | std::cout << id.size() << '\n'; 12 | std::cout << std::boolalpha << id.is_nil() << '\n'; 13 | std::cout << id.variant() << '\n'; 14 | std::cout << id.version() << '\n'; 15 | } -------------------------------------------------------------------------------- /examples/uuid_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/uuid_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/variant_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/variant_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | boost::variant v; 7 | v = 3.14; 8 | v = 'A'; 9 | v = "Boost"; 10 | } -------------------------------------------------------------------------------- /examples/variant_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/variant_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | boost::variant v; 8 | v = 3.14; 9 | std::cout << boost::get(v) << '\n'; 10 | v = 'A'; 11 | std::cout << boost::get(v) << '\n'; 12 | v = "Boost"; 13 | std::cout << boost::get(v) << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/variant_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/variant_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | boost::variant v; 8 | v = 3.14; 9 | std::cout << v << '\n'; 10 | v = 'A'; 11 | std::cout << v << '\n'; 12 | v = "Boost"; 13 | std::cout << v << '\n'; 14 | } -------------------------------------------------------------------------------- /examples/variant_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/variant_05/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/xpressive_01/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/xpressive_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::xpressive; 6 | 7 | int main() 8 | { 9 | std::string s = "Boost Libraries"; 10 | sregex expr = sregex::compile("\\w+\\s\\w+"); 11 | std::cout << std::boolalpha << regex_match(s, expr) << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/xpressive_02/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/xpressive_02/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace boost::xpressive; 5 | 6 | int main() 7 | { 8 | const char *c = "Boost Libraries"; 9 | cregex expr = cregex::compile("\\w+\\s\\w+"); 10 | std::cout << std::boolalpha << regex_match(c, expr) << '\n'; 11 | } -------------------------------------------------------------------------------- /examples/xpressive_03/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /examples/xpressive_03/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace boost::xpressive; 6 | 7 | int main() 8 | { 9 | std::string s = "Boost Libraries"; 10 | sregex expr = +_w >> _s >> +_w; 11 | std::cout << std::boolalpha << regex_match(s, expr) << '\n'; 12 | } -------------------------------------------------------------------------------- /examples/xpressive_04/Jamfile.jam: -------------------------------------------------------------------------------- 1 | exe test : main.cpp ..//boost_headers ; 2 | stage . : test ; 3 | -------------------------------------------------------------------------------- /exercises/assign_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::vector v; 9 | v.push_back(1); 10 | v.push_back(2); 11 | v.push_back(3); 12 | std::copy(v.begin(), v.end(), std::ostream_iterator(std::cout)); 13 | v.push_back(4); 14 | v.push_back(5); 15 | v.push_back(6); 16 | std::copy(v.begin(), v.end(), std::ostream_iterator(std::cout)); 17 | } 18 | -------------------------------------------------------------------------------- /exercises/enableif_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | template 4 | void print_has_post_increment() 5 | { 6 | // TODO: Implement this function. 7 | } 8 | 9 | int main() 10 | { 11 | print_has_post_increment(); 12 | print_has_post_increment(); 13 | print_has_post_increment(); 14 | } 15 | -------------------------------------------------------------------------------- /exercises/propertytree_01/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "animals": [ 3 | { 4 | "name": "cat", 5 | "legs": 4, 6 | "has_tail": true 7 | }, 8 | { 9 | "name": "spider", 10 | "legs": 8, 11 | "has_tail": false 12 | } 13 | ], 14 | "log": { 15 | "all": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /exercises/thread_01/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | boost::timer::cpu_timer timer; 8 | 9 | std::uint64_t total = 0; 10 | for (int i = 0; i < 1'000'000'000; ++i) 11 | total += i; 12 | 13 | std::cout << timer.format(); 14 | std::cout << total << '\n'; 15 | } 16 | --------------------------------------------------------------------------------