diff --git a/doc/modules/ROOT/examples b/doc/modules/ROOT/examples index 9f9d1de88..9f480167d 120000 --- a/doc/modules/ROOT/examples +++ b/doc/modules/ROOT/examples @@ -1 +1 @@ -../../../examples \ No newline at end of file +../../../example \ No newline at end of file diff --git a/doc/modules/ROOT/pages/basics.adoc b/doc/modules/ROOT/pages/basics.adoc index b2db4523e..fbc4f8606 100644 --- a/doc/modules/ROOT/pages/basics.adoc +++ b/doc/modules/ROOT/pages/basics.adoc @@ -99,7 +99,7 @@ The entire library can be accessed using the convenience header `` Example -This example can be found in the `examples/` folder as https://github.com/boostorg/decimal/blob/develop/examples/charconv_cohort_preservation.cpp[charconv_cohort_preservation.cpp]. +This example can be found in the `example/` folder as https://github.com/boostorg/decimal/blob/develop/example/charconv_cohort_preservation.cpp[charconv_cohort_preservation.cpp]. [source, c++] ---- diff --git a/doc/modules/ROOT/pages/conversions.adoc b/doc/modules/ROOT/pages/conversions.adoc index cf0a80782..b80890304 100644 --- a/doc/modules/ROOT/pages/conversions.adoc +++ b/doc/modules/ROOT/pages/conversions.adoc @@ -118,7 +118,7 @@ constexpr T from_dpd(unsigned __int128 bits) noexcept; == Bit Conversions Example -The following example is copied and pasted from the examples/ folder of the library and is called https://github.com/boostorg/decimal/blob/develop/examples/bit_conversions.cpp[bit_conversions.cpp]. +The following example is copied and pasted from the example/ folder of the library and is called https://github.com/boostorg/decimal/blob/develop/example/bit_conversions.cpp[bit_conversions.cpp]. [source, c++] ---- diff --git a/doc/modules/ROOT/pages/examples.adoc b/doc/modules/ROOT/pages/examples.adoc index ea27b37d9..98210a0e3 100644 --- a/doc/modules/ROOT/pages/examples.adoc +++ b/doc/modules/ROOT/pages/examples.adoc @@ -9,11 +9,11 @@ https://www.boost.org/LICENSE_1_0.txt :idprefix: examples_ The following examples will help you get up and running with many of the major parts of the library. -All of these examples can be found in the library `examples/` folder as well. +All of these examples can be found in the library `example/` folder as well. [#examples_construction] == Basic Construction -.This https://github.com/boostorg/decimal/blob/develop/examples/basic_construction.cpp[example] demonstrates the basic use of the various constructors offered by the decimal types +.This https://github.com/boostorg/decimal/blob/develop/example/basic_construction.cpp[example] demonstrates the basic use of the various constructors offered by the decimal types ==== [source, c++] ---- @@ -36,7 +36,7 @@ Can not construct from invalid string [#examples_basic_math] == Basic Arithmetic -.This https://github.com/boostorg/decimal/blob/develop/examples/basic_arithmetic.cpp[example] demonstrates the behavior and functionality of arithmetic using a single type +.This https://github.com/boostorg/decimal/blob/develop/example/basic_arithmetic.cpp[example] demonstrates the behavior and functionality of arithmetic using a single type ==== [source, c++] ---- @@ -55,7 +55,7 @@ Wolfram Alpha sqrt(2): 1.414213562373095 ==== [#examples_math_results] -.This https://github.com/boostorg/decimal/blob/develop/examples/addition.cpp[example] shows the differences in arithmetic results between decimal floating point and binary floating point +.This https://github.com/boostorg/decimal/blob/develop/example/addition.cpp[example] shows the differences in arithmetic results between decimal floating point and binary floating point ==== [source,c++] ---- @@ -75,7 +75,7 @@ Decimal Result: 100 [#examples_integer_conversions] === Integral Conversions -.This https://github.com/boostorg/decimal/blob/develop/examples/integral_conversions.cpp[example] shows how to construct an integral value from decimal type and vice versa, as well as the behavior +.This https://github.com/boostorg/decimal/blob/develop/example/integral_conversions.cpp[example] shows how to construct an integral value from decimal type and vice versa, as well as the behavior ==== [source, c++] @@ -107,7 +107,7 @@ decimal32_t from max: 1.844674e+19 [#examples_binary_floating_conversions] === Binary Floating Point Conversions -.This https://github.com/boostorg/decimal/blob/develop/examples/binary_float_conversions.cpp[example] shows how to construct a binary floating point value from decimal type and vice versa, as well as the behavior +.This https://github.com/boostorg/decimal/blob/develop/example/binary_float_conversions.cpp[example] shows how to construct a binary floating point value from decimal type and vice versa, as well as the behavior ==== [source,c++] ---- @@ -128,7 +128,7 @@ decimal32_t pi: 3.141593 [#examples_promotion] == Promotion and Mixed Decimal Arithmetic -.This https://github.com/boostorg/decimal/blob/develop/examples/promotion.cpp[example] demonstrates the behaviors of promotion between types, and mixed decimal type arithmetic +.This https://github.com/boostorg/decimal/blob/develop/example/promotion.cpp[example] demonstrates the behaviors of promotion between types, and mixed decimal type arithmetic ==== [source, c++] ---- @@ -151,7 +151,7 @@ The result of 2*c is a decimal64_t: 18.2 [#examples_charconv] == `` -.This https://github.com/boostorg/decimal/blob/develop/examples/charconv.cpp[example] demonstrates the fundamentals of the `` like functions provided by the library +.This https://github.com/boostorg/decimal/blob/develop/example/charconv.cpp[example] demonstrates the fundamentals of the `` like functions provided by the library ==== [source, c++] ---- @@ -169,7 +169,7 @@ Value in scientific format with precision 20: -7.12345000000000000000e+06 [#examples_generic_programming] == Generic Programming -.This https://github.com/boostorg/decimal/blob/develop/examples/adl.cpp[example] demonstrates how to write generic code that accepts both built-in floating point types, and decimal floating point values from this library +.This https://github.com/boostorg/decimal/blob/develop/example/adl.cpp[example] demonstrates how to write generic code that accepts both built-in floating point types, and decimal floating point values from this library ==== [source, c++] ---- @@ -206,7 +206,7 @@ sin(-0.5) = -0.479426 [#examples_literals_constants] == Literals and Constants -.This https://github.com/boostorg/decimal/blob/develop/examples/literals.cpp[example] demonstrates how to construct values using literals, and the usage of numerical constants that are provided by the library +.This https://github.com/boostorg/decimal/blob/develop/example/literals.cpp[example] demonstrates how to construct values using literals, and the usage of numerical constants that are provided by the library ==== [source, c++] ---- @@ -233,7 +233,7 @@ pass:[{fmt}] support is available starting with pass:[C++14] so long as you have [#examples_fmt_format] === `` -.This https://github.com/boostorg/decimal/blob/develop/examples/fmt_format.cpp[example] demonstrates the various formatting options provided by the library to support usage of pass:[{fmt}] +.This https://github.com/boostorg/decimal/blob/develop/example/fmt_format.cpp[example] demonstrates the various formatting options provided by the library to support usage of pass:[{fmt}] ==== [source, c++] ---- @@ -339,7 +339,7 @@ You must include it yourself. Taking the above example of pass:[{fmt}] and replacing all instances of `namespace fmt` with `namespace std` gives us another working example. -.This https://github.com/boostorg/decimal/blob/develop/examples/format.cpp[example] demonstrates how to use `` with the library in-place or in addition to pass:[{fmt}] +.This https://github.com/boostorg/decimal/blob/develop/example/format.cpp[example] demonstrates how to use `` with the library in-place or in addition to pass:[{fmt}] ==== [source, c++] ---- @@ -383,7 +383,7 @@ Combined Format Specifiers: [#examples_print] === `` -.This https://github.com/boostorg/decimal/blob/develop/examples/print.cpp[example] demonstrates how to use `` with the library +.This https://github.com/boostorg/decimal/blob/develop/example/print.cpp[example] demonstrates how to use `` with the library ==== [source, c++] ---- diff --git a/doc/modules/ROOT/pages/financial_examples.adoc b/doc/modules/ROOT/pages/financial_examples.adoc index 46c952af0..87f114be0 100644 --- a/doc/modules/ROOT/pages/financial_examples.adoc +++ b/doc/modules/ROOT/pages/financial_examples.adoc @@ -9,11 +9,11 @@ https://www.boost.org/LICENSE_1_0.txt :idprefix: financial_examples_ Below are a few additional examples as to how the Decimal library can be used in the context of financial applications. -All of these examples can be found in the library `examples/` folder as well. +All of these examples can be found in the library `example/` folder as well. == Parsing Pricing Data from File [#examples_money_parsing] -.This https://github.com/boostorg/decimal/blob/develop/examples/numerical_parsing.cpp[example] demonstrates the numerical differences between parsing of monetary values between using `decimal32_t` and `float` +.This https://github.com/boostorg/decimal/blob/develop/example/numerical_parsing.cpp[example] demonstrates the numerical differences between parsing of monetary values between using `decimal32_t` and `float` ==== [source, c++] ---- @@ -31,7 +31,7 @@ Sum using decimal32_t: 52151.99 [#examples_boost_math] == Boost.Math to Calculate Bollinger Bands -.This https://github.com/boostorg/decimal/blob/develop/examples/statistics.cpp[example] demonstrates how we can use the decimal library with existing Boost.Math facilities to perform statistical analysis +.This https://github.com/boostorg/decimal/blob/develop/example/statistics.cpp[example] demonstrates how we can use the decimal library with existing Boost.Math facilities to perform statistical analysis ==== [source, c++] ---- diff --git a/doc/modules/ROOT/pages/format.adoc b/doc/modules/ROOT/pages/format.adoc index b87ff2500..2660e1105 100644 --- a/doc/modules/ROOT/pages/format.adoc +++ b/doc/modules/ROOT/pages/format.adoc @@ -84,7 +84,7 @@ String literal pass:["{Sign, Padding, Precision, Type, Locale}"] == Examples -This example can be found in the examples/ folder as https://github.com/boostorg/decimal/blob/develop/examples/fmt_format.cpp[fmt_format.cpp] +This example can be found in the example/ folder as https://github.com/boostorg/decimal/blob/develop/example/fmt_format.cpp[fmt_format.cpp] The header `` is *NOT* part of the convenience header, because it is an optional dependency on a potentially compiled library. diff --git a/examples/.gitignore b/example/.gitignore similarity index 100% rename from examples/.gitignore rename to example/.gitignore diff --git a/examples/AAPL.csv b/example/AAPL.csv similarity index 100% rename from examples/AAPL.csv rename to example/AAPL.csv diff --git a/examples/addition.cpp b/example/addition.cpp similarity index 100% rename from examples/addition.cpp rename to example/addition.cpp diff --git a/examples/adl.cpp b/example/adl.cpp similarity index 100% rename from examples/adl.cpp rename to example/adl.cpp diff --git a/examples/basic_arithmetic.cpp b/example/basic_arithmetic.cpp similarity index 100% rename from examples/basic_arithmetic.cpp rename to example/basic_arithmetic.cpp diff --git a/examples/basic_construction.cpp b/example/basic_construction.cpp similarity index 100% rename from examples/basic_construction.cpp rename to example/basic_construction.cpp diff --git a/examples/binary_float_conversions.cpp b/example/binary_float_conversions.cpp similarity index 100% rename from examples/binary_float_conversions.cpp rename to example/binary_float_conversions.cpp diff --git a/examples/bit_conversions.cpp b/example/bit_conversions.cpp similarity index 100% rename from examples/bit_conversions.cpp rename to example/bit_conversions.cpp diff --git a/examples/charconv.cpp b/example/charconv.cpp similarity index 100% rename from examples/charconv.cpp rename to example/charconv.cpp diff --git a/examples/charconv_cohort_preservation.cpp b/example/charconv_cohort_preservation.cpp similarity index 100% rename from examples/charconv_cohort_preservation.cpp rename to example/charconv_cohort_preservation.cpp diff --git a/examples/debugger.cpp b/example/debugger.cpp similarity index 100% rename from examples/debugger.cpp rename to example/debugger.cpp diff --git a/examples/first_example.cpp b/example/first_example.cpp similarity index 100% rename from examples/first_example.cpp rename to example/first_example.cpp diff --git a/examples/fmt_format.cpp b/example/fmt_format.cpp similarity index 100% rename from examples/fmt_format.cpp rename to example/fmt_format.cpp diff --git a/examples/format.cpp b/example/format.cpp similarity index 100% rename from examples/format.cpp rename to example/format.cpp diff --git a/examples/integral_conversions.cpp b/example/integral_conversions.cpp similarity index 100% rename from examples/integral_conversions.cpp rename to example/integral_conversions.cpp diff --git a/examples/literals.cpp b/example/literals.cpp similarity index 100% rename from examples/literals.cpp rename to example/literals.cpp diff --git a/examples/numerical_parsing.cpp b/example/numerical_parsing.cpp similarity index 100% rename from examples/numerical_parsing.cpp rename to example/numerical_parsing.cpp diff --git a/examples/print.cpp b/example/print.cpp similarity index 100% rename from examples/print.cpp rename to example/print.cpp diff --git a/examples/promotion.cpp b/example/promotion.cpp similarity index 100% rename from examples/promotion.cpp rename to example/promotion.cpp diff --git a/examples/rounding_mode.cpp b/example/rounding_mode.cpp similarity index 100% rename from examples/rounding_mode.cpp rename to example/rounding_mode.cpp diff --git a/examples/rounding_mode_compile_time.cpp b/example/rounding_mode_compile_time.cpp similarity index 100% rename from examples/rounding_mode_compile_time.cpp rename to example/rounding_mode_compile_time.cpp diff --git a/examples/statistics.cpp b/example/statistics.cpp similarity index 100% rename from examples/statistics.cpp rename to example/statistics.cpp diff --git a/examples/to_from_file.cpp b/example/to_from_file.cpp similarity index 100% rename from examples/to_from_file.cpp rename to example/to_from_file.cpp diff --git a/examples/where_file.hpp b/example/where_file.hpp similarity index 90% rename from examples/where_file.hpp rename to example/where_file.hpp index e3effa8fc..056093dbf 100644 --- a/examples/where_file.hpp +++ b/example/where_file.hpp @@ -19,7 +19,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string // in order to find out where it is located. // Boost-root - std::string test_vectors_filename_relative = "libs/decimal/examples/" + test_vectors_filename; + std::string test_vectors_filename_relative = "libs/decimal/example/" + test_vectors_filename; std::ifstream in_01(test_vectors_filename_relative.c_str()); @@ -33,7 +33,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string else { // Local test directory or IDE - test_vectors_filename_relative = "../examples/" + test_vectors_filename; + test_vectors_filename_relative = "../example/" + test_vectors_filename; std::ifstream in_02(test_vectors_filename_relative.c_str()); @@ -46,7 +46,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string else { // test/cover - test_vectors_filename_relative = "../../examples/" + test_vectors_filename; + test_vectors_filename_relative = "../../example/" + test_vectors_filename; std::ifstream in_03(test_vectors_filename_relative.c_str()); @@ -59,7 +59,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string else { // CMake builds - test_vectors_filename_relative = "../../../../libs/decimal/examples/" + test_vectors_filename; + test_vectors_filename_relative = "../../../../libs/decimal/example/" + test_vectors_filename; std::ifstream in_04(test_vectors_filename_relative.c_str()); @@ -85,7 +85,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string else { // Clion Cmake builds - test_vectors_filename_relative = "../../../libs/decimal/examples/" + test_vectors_filename; + test_vectors_filename_relative = "../../../libs/decimal/example/" + test_vectors_filename; std::ifstream in_06(test_vectors_filename_relative.c_str()); diff --git a/modules/Jamfile b/module/Jamfile similarity index 100% rename from modules/Jamfile rename to module/Jamfile diff --git a/modules/decimal.cxx b/module/decimal.cxx similarity index 100% rename from modules/decimal.cxx rename to module/decimal.cxx diff --git a/modules/quick_test.cpp b/module/quick_test.cpp similarity index 100% rename from modules/quick_test.cpp rename to module/quick_test.cpp diff --git a/test/Jamfile b/test/Jamfile index a389ccf94..1699a65ff 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -213,27 +213,27 @@ run test_zeta.cpp ; run limits_link_1.cpp limits_link_2.cpp limits_link_3.cpp ; # Run the examples too -run ../examples/adl.cpp ; -run ../examples/basic_construction.cpp ; -run ../examples/bit_conversions.cpp ; -run ../examples/charconv.cpp ; -run ../examples/charconv_cohort_preservation.cpp ; -run ../examples/literals.cpp ; -run ../examples/rounding_mode.cpp ; -run ../examples/rounding_mode_compile_time.cpp ; -run ../examples/statistics.cpp ; -run ../examples/format.cpp ; -run ../examples/fmt_format.cpp ; -run ../examples/print.cpp ; -run ../examples/promotion.cpp ; -run ../examples/numerical_parsing.cpp ; -run ../examples/first_example.cpp ; -run ../examples/basic_arithmetic.cpp ; -run ../examples/to_from_file.cpp ; -run ../examples/addition.cpp ; -run ../examples/debugger.cpp ; -run ../examples/binary_float_conversions.cpp ; -run ../examples/integral_conversions.cpp ; +run ../example/adl.cpp ; +run ../example/basic_construction.cpp ; +run ../example/bit_conversions.cpp ; +run ../example/charconv.cpp ; +run ../example/charconv_cohort_preservation.cpp ; +run ../example/literals.cpp ; +run ../example/rounding_mode.cpp ; +run ../example/rounding_mode_compile_time.cpp ; +run ../example/statistics.cpp ; +run ../example/format.cpp ; +run ../example/fmt_format.cpp ; +run ../example/print.cpp ; +run ../example/promotion.cpp ; +run ../example/numerical_parsing.cpp ; +run ../example/first_example.cpp ; +run ../example/basic_arithmetic.cpp ; +run ../example/to_from_file.cpp ; +run ../example/addition.cpp ; +run ../example/debugger.cpp ; +run ../example/binary_float_conversions.cpp ; +run ../example/integral_conversions.cpp ; # Test compilation of separate headers compile compile_tests/bid_conversion.cpp ; diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index 38e25e9c6..03c42dab5 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -8,26 +8,6 @@ project(cmake_subdir_test LANGUAGES CXX) add_subdirectory(../.. boostorg/decimal) -set(deps - -# Primary dependencies - -assert -config -core - -# Secondary dependencies - -static_assert -throw_exception -) - -foreach(dep IN LISTS deps) - - add_subdirectory(../../../${dep} boostorg/${dep}) - -endforeach() - add_executable(quick ../quick.cpp) target_link_libraries(quick Boost::decimal)