mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 10:27:16 +02:00
25
conanfile.py
25
conanfile.py
@ -56,6 +56,7 @@ class MPUnitsConan(ConanFile):
|
|||||||
settings = "os", "arch", "compiler", "build_type"
|
settings = "os", "arch", "compiler", "build_type"
|
||||||
options = {
|
options = {
|
||||||
"cxx_modules": [True, False],
|
"cxx_modules": [True, False],
|
||||||
|
"import_std": [True, False],
|
||||||
"std_format": [True, False],
|
"std_format": [True, False],
|
||||||
"string_view_ret": [True, False],
|
"string_view_ret": [True, False],
|
||||||
"no_crtp": [True, False],
|
"no_crtp": [True, False],
|
||||||
@ -64,6 +65,7 @@ class MPUnitsConan(ConanFile):
|
|||||||
}
|
}
|
||||||
default_options = {
|
default_options = {
|
||||||
# "cxx_modules" default set in config_options()
|
# "cxx_modules" default set in config_options()
|
||||||
|
# "import_std" default set in config_options()
|
||||||
# "std_format" default set in config_options()
|
# "std_format" default set in config_options()
|
||||||
# "string_view_ret" default set in config_options()
|
# "string_view_ret" default set in config_options()
|
||||||
# "no_crtp" default set in config_options()
|
# "no_crtp" default set in config_options()
|
||||||
@ -108,6 +110,10 @@ class MPUnitsConan(ConanFile):
|
|||||||
"min_cppstd": "20",
|
"min_cppstd": "20",
|
||||||
"compiler": {"gcc": "", "clang": "17", "apple-clang": "", "msvc": ""},
|
"compiler": {"gcc": "", "clang": "17", "apple-clang": "", "msvc": ""},
|
||||||
},
|
},
|
||||||
|
"import_std": {
|
||||||
|
"min_cppstd": "23",
|
||||||
|
"compiler": {"gcc": "", "clang": "18", "apple-clang": "", "msvc": ""},
|
||||||
|
},
|
||||||
"static_constexpr_vars_in_constexpr_func": {
|
"static_constexpr_vars_in_constexpr_func": {
|
||||||
"min_cppstd": "23",
|
"min_cppstd": "23",
|
||||||
"compiler": {"gcc": "13", "clang": "17", "apple-clang": "", "msvc": ""},
|
"compiler": {"gcc": "13", "clang": "17", "apple-clang": "", "msvc": ""},
|
||||||
@ -128,6 +134,7 @@ class MPUnitsConan(ConanFile):
|
|||||||
return {
|
return {
|
||||||
"std_format": "std_format",
|
"std_format": "std_format",
|
||||||
"cxx_modules": "cxx_modules",
|
"cxx_modules": "cxx_modules",
|
||||||
|
"import_std": "import_std",
|
||||||
"string_view_ret": "static_constexpr_vars_in_constexpr_func",
|
"string_view_ret": "static_constexpr_vars_in_constexpr_func",
|
||||||
"no_crtp": "explicit_this",
|
"no_crtp": "explicit_this",
|
||||||
}
|
}
|
||||||
@ -210,7 +217,7 @@ class MPUnitsConan(ConanFile):
|
|||||||
self.requires("fmt/11.0.1")
|
self.requires("fmt/11.0.1")
|
||||||
|
|
||||||
def build_requirements(self):
|
def build_requirements(self):
|
||||||
self.tool_requires("cmake/[>=3.29 <4]")
|
self.tool_requires("cmake/[>=3.30 <4]")
|
||||||
if self._build_all:
|
if self._build_all:
|
||||||
if not self.options.freestanding:
|
if not self.options.freestanding:
|
||||||
self.test_requires("catch2/3.6.0")
|
self.test_requires("catch2/3.6.0")
|
||||||
@ -226,6 +233,16 @@ class MPUnitsConan(ConanFile):
|
|||||||
raise ConanInvalidConfiguration(
|
raise ConanInvalidConfiguration(
|
||||||
"'contracts' should be set to 'none' for a freestanding build"
|
"'contracts' should be set to 'none' for a freestanding build"
|
||||||
)
|
)
|
||||||
|
# mixing of `import std;` and regular header files includes does not work for now
|
||||||
|
if self.options.import_std:
|
||||||
|
if self.options.contracts != "none":
|
||||||
|
raise ConanInvalidConfiguration(
|
||||||
|
"'contracts' should be set to 'none' to use `import std;`"
|
||||||
|
)
|
||||||
|
if not self.options.std_format:
|
||||||
|
raise ConanInvalidConfiguration(
|
||||||
|
"'std_format' should be enabled to use `import std;`"
|
||||||
|
)
|
||||||
|
|
||||||
def layout(self):
|
def layout(self):
|
||||||
cmake_layout(self)
|
cmake_layout(self)
|
||||||
@ -242,6 +259,12 @@ class MPUnitsConan(ConanFile):
|
|||||||
if self.options.cxx_modules:
|
if self.options.cxx_modules:
|
||||||
tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True
|
tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True
|
||||||
tc.cache_variables["MP_UNITS_BUILD_CXX_MODULES"] = True
|
tc.cache_variables["MP_UNITS_BUILD_CXX_MODULES"] = True
|
||||||
|
if self.options.import_std:
|
||||||
|
tc.cache_variables["CMAKE_CXX_MODULE_STD"] = True
|
||||||
|
# Current experimental support according to `Help/dev/experimental.rst`
|
||||||
|
tc.cache_variables[
|
||||||
|
"CMAKE_EXPERIMENTAL_CXX_IMPORT_STD"
|
||||||
|
] = "0e5b6991-d74f-4b3d-a41c-cf096e0b2508"
|
||||||
if self.options.freestanding:
|
if self.options.freestanding:
|
||||||
tc.cache_variables["MP_UNITS_API_FREESTANDING"] = True
|
tc.cache_variables["MP_UNITS_API_FREESTANDING"] = True
|
||||||
else:
|
else:
|
||||||
|
@ -237,6 +237,14 @@ tools.build:compiler_executables={"c": "gcc-12", "cpp": "g++-12"}
|
|||||||
|
|
||||||
[conan C++ modules support]: https://github.com/mpusz/mp-units/releases/tag/v2.2.0
|
[conan C++ modules support]: https://github.com/mpusz/mp-units/releases/tag/v2.2.0
|
||||||
|
|
||||||
|
[`import_std`](#import_std){ #import_std }
|
||||||
|
|
||||||
|
: [:octicons-tag-24: 2.3.0][conan import std support] · :octicons-milestone-24: `True`/`False` (Default: automatically determined from settings)
|
||||||
|
|
||||||
|
Enables `import std;` usage.
|
||||||
|
|
||||||
|
[conan import std support]: https://github.com/mpusz/mp-units/releases/tag/v2.3.0
|
||||||
|
|
||||||
[`std_format`](#std_format){ #std_format }
|
[`std_format`](#std_format){ #std_format }
|
||||||
|
|
||||||
: [:octicons-tag-24: 2.2.0][conan std::format support] · :octicons-milestone-24: `True`/`False` (Default: automatically determined from settings)
|
: [:octicons-tag-24: 2.2.0][conan std::format support] · :octicons-milestone-24: `True`/`False` (Default: automatically determined from settings)
|
||||||
@ -338,7 +346,14 @@ tools.build:compiler_executables={"c": "gcc-12", "cpp": "g++-12"}
|
|||||||
|
|
||||||
Adds C++ modules to the list of default targets.
|
Adds C++ modules to the list of default targets.
|
||||||
|
|
||||||
[build_cxx_modules support]: https://github.com/mpusz/mp-units/releases/tag/v2.2.0
|
|
||||||
|
[`MP_UNITS_BUILD_IMPORT_STD`](#MP_UNITS_BUILD_IMPORT_STD){ #MP_UNITS_BUILD_IMPORT_STD }
|
||||||
|
|
||||||
|
: [:octicons-tag-24: 2.3.0][cmake import std support] · :octicons-milestone-24: `ON`/`OFF` (Default: `OFF`)
|
||||||
|
|
||||||
|
Enables `import std;` usage.
|
||||||
|
|
||||||
|
[cmake import std support]: https://github.com/mpusz/mp-units/releases/tag/v2.3.0
|
||||||
|
|
||||||
[`MP_UNITS_API_STD_FORMAT`](#MP_UNITS_API_STD_FORMAT){ #MP_UNITS_API_STD_FORMAT }
|
[`MP_UNITS_API_STD_FORMAT`](#MP_UNITS_API_STD_FORMAT){ #MP_UNITS_API_STD_FORMAT }
|
||||||
|
|
||||||
|
@ -25,8 +25,12 @@
|
|||||||
// !!! renders correctly in the documentation "Examples" section. !!!
|
// !!! renders correctly in the documentation "Examples" section. !!!
|
||||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -20,7 +20,11 @@
|
|||||||
physical_quantities
|
physical_quantities
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -17,7 +17,11 @@
|
|||||||
|
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -17,9 +17,13 @@
|
|||||||
|
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -21,11 +21,15 @@
|
|||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units.core;
|
import mp_units.core;
|
||||||
#else
|
#else
|
||||||
|
@ -22,9 +22,13 @@
|
|||||||
|
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
#include <mp-units/bits/hacks.h>
|
#include <mp-units/bits/hacks.h>
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
@ -33,6 +36,7 @@
|
|||||||
#include <ranges>
|
#include <ranges>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,10 +22,14 @@
|
|||||||
|
|
||||||
#include "glide_computer_lib.h"
|
#include "glide_computer_lib.h"
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units.core;
|
import mp_units.core;
|
||||||
#else
|
#else
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
//
|
//
|
||||||
#include "geographic.h"
|
#include "geographic.h"
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@ -35,6 +38,7 @@
|
|||||||
#include <ranges>
|
#include <ranges>
|
||||||
#include <string> // IWYU pragma: keep
|
#include <string> // IWYU pragma: keep
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -27,8 +27,12 @@
|
|||||||
|
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -25,10 +25,14 @@
|
|||||||
#include "ranged_representation.h"
|
#include "ranged_representation.h"
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <compare>
|
#include <compare>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <numbers>
|
#include <numbers>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -26,9 +26,13 @@
|
|||||||
#include <mp-units/bits/hacks.h>
|
#include <mp-units/bits/hacks.h>
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units.core;
|
import mp_units.core;
|
||||||
#else
|
#else
|
||||||
|
@ -26,9 +26,13 @@
|
|||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/contracts.h>
|
#include <mp-units/ext/contracts.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <compare> // IWYU pragma: export
|
#include <compare> // IWYU pragma: export
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units.core;
|
import mp_units.core;
|
||||||
#else
|
#else
|
||||||
|
@ -24,9 +24,13 @@
|
|||||||
|
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
|
|
||||||
#include "kalman.h"
|
#include "kalman.h"
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
|
|
||||||
#include "kalman.h"
|
#include "kalman.h"
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
|
|
||||||
#include "kalman.h"
|
#include "kalman.h"
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
|
|
||||||
#include "kalman.h"
|
#include "kalman.h"
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
|
|
||||||
#include "kalman.h"
|
#include "kalman.h"
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
|
|
||||||
#include "kalman.h"
|
#include "kalman.h"
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
|
|
||||||
#include "kalman.h"
|
#include "kalman.h"
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
|
|
||||||
#include "kalman.h"
|
#include "kalman.h"
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,11 +22,15 @@
|
|||||||
|
|
||||||
#include <mp-units/bits/hacks.h>
|
#include <mp-units/bits/hacks.h>
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <compare> // IWYU pragma: export
|
#include <compare> // IWYU pragma: export
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -27,7 +27,11 @@
|
|||||||
|
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
|
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -23,10 +23,14 @@
|
|||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <numbers>
|
#include <numbers>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -20,7 +20,11 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -20,8 +20,12 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -25,9 +25,13 @@
|
|||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -38,9 +38,11 @@ check_libcxx_in_use(${projectPrefix}LIBCXX)
|
|||||||
# project build options
|
# project build options
|
||||||
option(${projectPrefix}BUILD_AS_SYSTEM_HEADERS "Exports library as system headers" OFF)
|
option(${projectPrefix}BUILD_AS_SYSTEM_HEADERS "Exports library as system headers" OFF)
|
||||||
option(${projectPrefix}BUILD_CXX_MODULES "Add C++ modules to the list of default targets" OFF)
|
option(${projectPrefix}BUILD_CXX_MODULES "Add C++ modules to the list of default targets" OFF)
|
||||||
|
option(${projectPrefix}BUILD_IMPORT_STD "Enable `import std;` usage" OFF)
|
||||||
|
|
||||||
message(STATUS "${projectPrefix}BUILD_AS_SYSTEM_HEADERS: ${${projectPrefix}BUILD_AS_SYSTEM_HEADERS}")
|
message(STATUS "${projectPrefix}BUILD_AS_SYSTEM_HEADERS: ${${projectPrefix}BUILD_AS_SYSTEM_HEADERS}")
|
||||||
message(STATUS "${projectPrefix}BUILD_CXX_MODULES: ${${projectPrefix}BUILD_CXX_MODULES}")
|
message(STATUS "${projectPrefix}BUILD_CXX_MODULES: ${${projectPrefix}BUILD_CXX_MODULES}")
|
||||||
|
message(STATUS "${projectPrefix}BUILD_IMPORT_STD: ${${projectPrefix}BUILD_IMPORT_STD}")
|
||||||
|
|
||||||
if(${projectPrefix}BUILD_AS_SYSTEM_HEADERS)
|
if(${projectPrefix}BUILD_AS_SYSTEM_HEADERS)
|
||||||
set(${projectPrefix}_AS_SYSTEM SYSTEM)
|
set(${projectPrefix}_AS_SYSTEM SYSTEM)
|
||||||
@ -124,6 +126,15 @@ else()
|
|||||||
set(${projectPrefix}TARGET_SCOPE "INTERFACE")
|
set(${projectPrefix}TARGET_SCOPE "INTERFACE")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "3.30")
|
||||||
|
message(FATAL_ERROR "CMake versions before 3.30 do not support `import std;` properly")
|
||||||
|
endif()
|
||||||
|
if(CMAKE_CXX_STANDARD LESS 23)
|
||||||
|
message(FATAL_ERROR "`import std;` requires at lease C++23")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# components/modules
|
# components/modules
|
||||||
include(MPUnitsContracts)
|
include(MPUnitsContracts)
|
||||||
add_subdirectory(core)
|
add_subdirectory(core)
|
||||||
|
@ -125,6 +125,14 @@ if(${projectPrefix}BUILD_CXX_MODULES)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${projectPrefix}BUILD_IMPORT_STD)
|
||||||
|
target_compile_definitions(mp-units-core PUBLIC ${projectPrefix}IMPORT_STD)
|
||||||
|
# https://github.com/llvm/llvm-project/issues/75057
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
|
||||||
|
target_compile_options(mp-units-core PUBLIC "-Wno-deprecated-declarations")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# UTF-8 source and execution character set
|
# UTF-8 source and execution character set
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
|
@ -43,6 +43,9 @@
|
|||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#if __cpp_lib_text_encoding
|
||||||
|
#include <text_encoding>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MP_UNITS_HOSTED
|
#if MP_UNITS_HOSTED
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
@ -53,7 +56,3 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __cpp_lib_text_encoding
|
|
||||||
#include <text_encoding>
|
|
||||||
#endif
|
|
||||||
|
@ -37,12 +37,16 @@
|
|||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
#include <mp-units/ext/contracts.h>
|
#include <mp-units/ext/contracts.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// most of the below code is based on/copied from fmtlib
|
// most of the below code is based on/copied from fmtlib
|
||||||
|
|
||||||
|
@ -28,10 +28,14 @@
|
|||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
#include <mp-units/ext/contracts.h>
|
#include <mp-units/ext/contracts.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <compare> // IWYU pragma: export
|
#include <compare> // IWYU pragma: export
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units::detail {
|
namespace mp_units::detail {
|
||||||
|
|
||||||
|
@ -29,8 +29,12 @@
|
|||||||
#include <mp-units/framework/symbol_text.h>
|
#include <mp-units/framework/symbol_text.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units::detail {
|
namespace mp_units::detail {
|
||||||
|
|
||||||
|
@ -25,10 +25,14 @@
|
|||||||
#include <mp-units/bits/hacks.h> // IWYU pragma: keep
|
#include <mp-units/bits/hacks.h> // IWYU pragma: keep
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
MP_UNITS_DIAGNOSTIC_PUSH
|
MP_UNITS_DIAGNOSTIC_PUSH
|
||||||
MP_UNITS_DIAGNOSTIC_IGNORE_EXPR_ALWAYS_TF
|
MP_UNITS_DIAGNOSTIC_IGNORE_EXPR_ALWAYS_TF
|
||||||
|
@ -29,10 +29,14 @@
|
|||||||
#include <mp-units/bits/hacks.h> // IWYU pragma: keep
|
#include <mp-units/bits/hacks.h> // IWYU pragma: keep
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <compare>
|
#include <compare>
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units::detail {
|
namespace mp_units::detail {
|
||||||
|
|
||||||
|
@ -33,17 +33,24 @@
|
|||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
#include <mp-units/ext/contracts.h>
|
#include <mp-units/ext/contracts.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <compare> // IWYU pragma: export
|
#include <compare> // IWYU pragma: export
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#endif // MP_UNITS_IMPORT_STD
|
||||||
|
|
||||||
#if MP_UNITS_HOSTED
|
#if MP_UNITS_HOSTED
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifndef MP_UNITS_IMPORT_STD
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif // MP_UNITS_HOSTED
|
||||||
|
#endif // MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
|
||||||
MP_UNITS_EXPORT
|
MP_UNITS_EXPORT
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
@ -36,7 +36,11 @@ MP_UNITS_DIAGNOSTIC_IGNORE_SHADOW
|
|||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
MP_UNITS_DIAGNOSTIC_POP
|
MP_UNITS_DIAGNOSTIC_POP
|
||||||
#else
|
#else
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <format>
|
#include <format>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -28,10 +28,14 @@
|
|||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
#include <mp-units/ext/contracts.h>
|
#include <mp-units/ext/contracts.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// NOLINTBEGIN(*-avoid-c-arrays)
|
// NOLINTBEGIN(*-avoid-c-arrays)
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
#include <mp-units/ext/algorithm.h>
|
#include <mp-units/ext/algorithm.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -35,6 +38,7 @@
|
|||||||
#include <optional>
|
#include <optional>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units::detail {
|
namespace mp_units::detail {
|
||||||
|
|
||||||
|
@ -6,8 +6,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units::detail {
|
namespace mp_units::detail {
|
||||||
|
|
||||||
|
@ -26,9 +26,13 @@
|
|||||||
#include <mp-units/bits/module_macros.h>
|
#include <mp-units/bits/module_macros.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -35,8 +35,12 @@
|
|||||||
#include <mp-units/framework/unit.h>
|
#include <mp-units/framework/unit.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units::detail {
|
namespace mp_units::detail {
|
||||||
|
|
||||||
|
@ -26,8 +26,12 @@
|
|||||||
#include <mp-units/bits/module_macros.h>
|
#include <mp-units/bits/module_macros.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <compare>
|
#include <compare>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
MP_UNITS_EXPORT
|
MP_UNITS_EXPORT
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
@ -28,8 +28,12 @@
|
|||||||
#include <mp-units/framework/representation_concepts.h>
|
#include <mp-units/framework/representation_concepts.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -27,10 +27,14 @@
|
|||||||
#include <mp-units/ext/type_traits.h>
|
#include <mp-units/ext/type_traits.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
#include <mp-units/ext/contracts.h>
|
#include <mp-units/ext/contracts.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
@ -44,7 +47,8 @@
|
|||||||
#if MP_UNITS_HOSTED
|
#if MP_UNITS_HOSTED
|
||||||
#include <string>
|
#include <string>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif // MP_UNITS_IMPORT_STD
|
||||||
|
#endif // MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -28,9 +28,13 @@
|
|||||||
#include <mp-units/ext/type_traits.h>
|
#include <mp-units/ext/type_traits.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -36,12 +36,16 @@
|
|||||||
#include <mp-units/framework/symbol_text.h>
|
#include <mp-units/framework/symbol_text.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <numbers>
|
#include <numbers>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -39,9 +39,13 @@
|
|||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
#include <mp-units/ext/contracts.h>
|
#include <mp-units/ext/contracts.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <compare> // IWYU pragma: export
|
#include <compare> // IWYU pragma: export
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -29,8 +29,12 @@
|
|||||||
#include <mp-units/framework/reference.h>
|
#include <mp-units/framework/reference.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
MP_UNITS_EXPORT
|
MP_UNITS_EXPORT
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
@ -31,8 +31,12 @@
|
|||||||
#include <mp-units/framework/quantity_point_concepts.h>
|
#include <mp-units/framework/quantity_point_concepts.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <compare> // IWYU pragma: export
|
#include <compare> // IWYU pragma: export
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -38,11 +38,15 @@
|
|||||||
#include <mp-units/framework/representation_concepts.h>
|
#include <mp-units/framework/representation_concepts.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -31,8 +31,12 @@
|
|||||||
#include <mp-units/framework/representation_concepts.h>
|
#include <mp-units/framework/representation_concepts.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -27,11 +27,15 @@
|
|||||||
#include <mp-units/framework/customization_points.h>
|
#include <mp-units/framework/customization_points.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -32,15 +32,23 @@
|
|||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
#include <mp-units/ext/contracts.h>
|
#include <mp-units/ext/contracts.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <compare> // IWYU pragma: export
|
#include <compare> // IWYU pragma: export
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __cpp_lib_text_encoding
|
#if __cpp_lib_text_encoding
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <text_encoding>
|
#include <text_encoding>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
static_assert(std::text_encoding::literal().mib() == std::text_encoding::id::UTF8);
|
static_assert(std::text_encoding::literal().mib() == std::text_encoding::id::UTF8);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -43,6 +43,9 @@
|
|||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
#include <mp-units/ext/contracts.h>
|
#include <mp-units/ext/contracts.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
@ -50,7 +53,8 @@
|
|||||||
#if MP_UNITS_HOSTED
|
#if MP_UNITS_HOSTED
|
||||||
#include <string>
|
#include <string>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif // MP_UNITS_IMPORT_STD
|
||||||
|
#endif // MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -32,10 +32,14 @@
|
|||||||
#include <mp-units/framework/value_cast.h>
|
#include <mp-units/framework/value_cast.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
MP_UNITS_EXPORT
|
MP_UNITS_EXPORT
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
@ -30,9 +30,13 @@
|
|||||||
#include <mp-units/framework/unit.h>
|
#include <mp-units/framework/unit.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -26,9 +26,11 @@
|
|||||||
#include <mp-units/framework/quantity.h>
|
#include <mp-units/framework/quantity.h>
|
||||||
|
|
||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
#ifndef MP_UNITS_IMPORT_STD
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <random>
|
#include <random>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -22,10 +22,16 @@
|
|||||||
|
|
||||||
module;
|
module;
|
||||||
|
|
||||||
|
#ifndef MP_UNITS_IMPORT_STD
|
||||||
#include <mp-units/bits/core_gmf.h>
|
#include <mp-units/bits/core_gmf.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
export module mp_units.core;
|
export module mp_units.core;
|
||||||
|
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MP_UNITS_IN_MODULE_INTERFACE
|
#define MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
|
@ -32,8 +32,12 @@
|
|||||||
#include <mp-units/framework/quantity.h>
|
#include <mp-units/framework/quantity.h>
|
||||||
#include <mp-units/framework/unit.h>
|
#include <mp-units/framework/unit.h>
|
||||||
#include <mp-units/framework/value_cast.h>
|
#include <mp-units/framework/value_cast.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
MP_UNITS_EXPORT
|
MP_UNITS_EXPORT
|
||||||
|
@ -32,8 +32,12 @@
|
|||||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||||
#include <mp-units/framework/customization_points.h>
|
#include <mp-units/framework/customization_points.h>
|
||||||
#include <mp-units/framework/quantity_point.h>
|
#include <mp-units/framework/quantity_point.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
|
@ -33,8 +33,12 @@
|
|||||||
#include <mp-units/framework/quantity.h>
|
#include <mp-units/framework/quantity.h>
|
||||||
#include <mp-units/framework/unit.h>
|
#include <mp-units/framework/unit.h>
|
||||||
#include <mp-units/framework/value_cast.h>
|
#include <mp-units/framework/value_cast.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
MP_UNITS_EXPORT
|
MP_UNITS_EXPORT
|
||||||
|
@ -22,12 +22,17 @@
|
|||||||
|
|
||||||
module;
|
module;
|
||||||
|
|
||||||
|
#ifndef MP_UNITS_IMPORT_STD
|
||||||
#include <mp-units/bits/core_gmf.h>
|
#include <mp-units/bits/core_gmf.h>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#endif
|
||||||
|
|
||||||
export module mp_units.systems;
|
export module mp_units.systems;
|
||||||
|
|
||||||
export import mp_units.core;
|
export import mp_units.core;
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MP_UNITS_IN_MODULE_INTERFACE
|
#define MP_UNITS_IN_MODULE_INTERFACE
|
||||||
|
|
||||||
|
@ -21,7 +21,11 @@
|
|||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -21,12 +21,16 @@
|
|||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -24,8 +24,12 @@
|
|||||||
#include <catch2/matchers/catch_matchers_exception.hpp>
|
#include <catch2/matchers/catch_matchers_exception.hpp>
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
#include <catch2/matchers/catch_matchers_exception.hpp>
|
#include <catch2/matchers/catch_matchers_exception.hpp>
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@ -32,6 +35,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -23,8 +23,12 @@
|
|||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <mp-units/compat_macros.h>
|
#include <mp-units/compat_macros.h>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <matrix>
|
#include <matrix>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -23,7 +23,11 @@
|
|||||||
#include "almost_equals.h"
|
#include "almost_equals.h"
|
||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <catch2/matchers/catch_matchers.hpp>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -25,8 +25,12 @@
|
|||||||
#include <catch2/catch_test_macros.hpp>
|
#include <catch2/catch_test_macros.hpp>
|
||||||
#include <catch2/matchers/catch_matchers.hpp>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
#include <mp-units/ext/format.h>
|
#include <mp-units/ext/format.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <numbers>
|
#include <numbers>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -21,7 +21,11 @@
|
|||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
#include <mp-units/systems/isq_angle.h>
|
#include <mp-units/systems/isq_angle.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <numbers>
|
#include <numbers>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -25,9 +25,13 @@
|
|||||||
#include <mp-units/framework/quantity_point.h> // IWYU pragma: keep
|
#include <mp-units/framework/quantity_point.h> // IWYU pragma: keep
|
||||||
#include <mp-units/systems/isq/si_quantities.h>
|
#include <mp-units/systems/isq/si_quantities.h>
|
||||||
#include <mp-units/systems/si.h>
|
#include <mp-units/systems/si.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <ratio>
|
#include <ratio>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
#include <mp-units/systems/isq/space_and_time.h>
|
#include <mp-units/systems/isq/space_and_time.h>
|
||||||
#include <mp-units/systems/natural.h>
|
#include <mp-units/systems/natural.h>
|
||||||
#include <mp-units/systems/si.h>
|
#include <mp-units/systems/si.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#if MP_UNITS_HOSTED
|
#if MP_UNITS_HOSTED
|
||||||
@ -30,6 +33,7 @@
|
|||||||
#include <complex>
|
#include <complex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MP_UNITS_HOSTED
|
#if MP_UNITS_HOSTED
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@ -20,8 +20,12 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
#ifdef MP_UNITS_MODULES
|
#ifdef MP_UNITS_MODULES
|
||||||
import mp_units;
|
import mp_units;
|
||||||
#else
|
#else
|
||||||
|
@ -24,8 +24,12 @@
|
|||||||
#include <mp-units/framework.h>
|
#include <mp-units/framework.h>
|
||||||
#include <mp-units/systems/si/prefixes.h>
|
#include <mp-units/systems/si/prefixes.h>
|
||||||
#include <mp-units/systems/si/units.h>
|
#include <mp-units/systems/si/units.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -22,7 +22,11 @@
|
|||||||
|
|
||||||
#include <mp-units/framework.h>
|
#include <mp-units/framework.h>
|
||||||
#include <mp-units/systems/isq.h>
|
#include <mp-units/systems/isq.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -23,7 +23,11 @@
|
|||||||
#include "test_tools.h"
|
#include "test_tools.h"
|
||||||
#include <mp-units/ext/type_traits.h>
|
#include <mp-units/ext/type_traits.h>
|
||||||
#include <mp-units/framework.h>
|
#include <mp-units/framework.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -21,8 +21,12 @@
|
|||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
#include <mp-units/ext/fixed_string.h>
|
#include <mp-units/ext/fixed_string.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace mp_units;
|
using namespace mp_units;
|
||||||
|
|
||||||
|
@ -21,9 +21,13 @@
|
|||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
#include <mp-units/ext/prime.h>
|
#include <mp-units/ext/prime.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace mp_units::detail;
|
using namespace mp_units::detail;
|
||||||
|
|
||||||
|
@ -26,6 +26,9 @@
|
|||||||
#include <mp-units/systems/isq.h>
|
#include <mp-units/systems/isq.h>
|
||||||
#include <mp-units/systems/si.h>
|
#include <mp-units/systems/si.h>
|
||||||
#include <mp-units/systems/usc.h>
|
#include <mp-units/systems/usc.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@ -34,6 +37,7 @@
|
|||||||
#if MP_UNITS_HOSTED
|
#if MP_UNITS_HOSTED
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -23,7 +23,11 @@
|
|||||||
#include "test_tools.h"
|
#include "test_tools.h"
|
||||||
#include <mp-units/ext/type_traits.h>
|
#include <mp-units/ext/type_traits.h>
|
||||||
#include <mp-units/framework.h>
|
#include <mp-units/framework.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -27,6 +27,9 @@
|
|||||||
#include <mp-units/systems/isq/mechanics.h>
|
#include <mp-units/systems/isq/mechanics.h>
|
||||||
#include <mp-units/systems/isq/space_and_time.h>
|
#include <mp-units/systems/isq/space_and_time.h>
|
||||||
#include <mp-units/systems/si.h>
|
#include <mp-units/systems/si.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@ -35,6 +38,7 @@
|
|||||||
#if MP_UNITS_HOSTED
|
#if MP_UNITS_HOSTED
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline constexpr bool mp_units::is_vector<int> = true;
|
inline constexpr bool mp_units::is_vector<int> = true;
|
||||||
|
@ -23,8 +23,12 @@
|
|||||||
#include "test_tools.h"
|
#include "test_tools.h"
|
||||||
#include <mp-units/framework.h>
|
#include <mp-units/framework.h>
|
||||||
#include <mp-units/systems/si/prefixes.h>
|
#include <mp-units/systems/si/prefixes.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -21,7 +21,11 @@
|
|||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
#include <mp-units/systems/si.h>
|
#include <mp-units/systems/si.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -24,7 +24,11 @@
|
|||||||
|
|
||||||
#include <mp-units/bits/hacks.h>
|
#include <mp-units/bits/hacks.h>
|
||||||
#include <mp-units/framework/quantity_spec.h>
|
#include <mp-units/framework/quantity_spec.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
|
|
||||||
template<auto V, typename T>
|
template<auto V, typename T>
|
||||||
inline constexpr bool is_of_type = std::is_same_v<MP_UNITS_REMOVE_CONST(decltype(V)), T>;
|
inline constexpr bool is_of_type = std::is_same_v<MP_UNITS_REMOVE_CONST(decltype(V)), T>;
|
||||||
|
@ -22,7 +22,11 @@
|
|||||||
|
|
||||||
#include <mp-units/bits/type_list.h>
|
#include <mp-units/bits/type_list.h>
|
||||||
#include <mp-units/ext/type_traits.h>
|
#include <mp-units/ext/type_traits.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -23,7 +23,11 @@
|
|||||||
#include <mp-units/systems/iau.h>
|
#include <mp-units/systems/iau.h>
|
||||||
#include <mp-units/systems/iec80000.h>
|
#include <mp-units/systems/iec80000.h>
|
||||||
#include <mp-units/systems/si.h>
|
#include <mp-units/systems/si.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -24,7 +24,11 @@
|
|||||||
#include <mp-units/ext/type_traits.h>
|
#include <mp-units/ext/type_traits.h>
|
||||||
#include <mp-units/framework.h>
|
#include <mp-units/framework.h>
|
||||||
#include <mp-units/systems/si/prefixes.h>
|
#include <mp-units/systems/si/prefixes.h>
|
||||||
|
#ifdef MP_UNITS_IMPORT_STD
|
||||||
|
import std;
|
||||||
|
#else
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user