diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 0cc5b140..2132d71a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -91,9 +91,10 @@ if(NOT ${projectPrefix}API_FREESTANDING) include/mp-units/bits/fmt.h include/mp-units/bits/requires_hosted.h include/mp-units/ext/format.h + include/mp-units/complex.h + include/mp-units/format.h include/mp-units/math.h include/mp-units/ostream.h - include/mp-units/format.h include/mp-units/random.h ) endif() diff --git a/src/core/include/mp-units/bits/core_gmf.h b/src/core/include/mp-units/bits/core_gmf.h index 5566bc92..d3a44fcb 100644 --- a/src/core/include/mp-units/bits/core_gmf.h +++ b/src/core/include/mp-units/bits/core_gmf.h @@ -57,6 +57,7 @@ #ifndef MP_UNITS_IMPORT_STD #include #include +#include #include #include #include diff --git a/src/core/include/mp-units/complex.h b/src/core/include/mp-units/complex.h new file mode 100644 index 00000000..9f09c05f --- /dev/null +++ b/src/core/include/mp-units/complex.h @@ -0,0 +1,43 @@ +// The MIT License (MIT) +// +// Copyright (c) 2018 Mateusz Pusz +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#pragma once + +#include +// +#include +#include + +#ifndef MP_UNITS_IN_MODULE_INTERFACE +#ifdef MP_UNITS_IMPORT_STD +import std; +#else +#include +#endif +#endif + +namespace mp_units { + +template +constexpr bool is_complex> = true; + +} diff --git a/src/core/include/mp-units/core.h b/src/core/include/mp-units/core.h index 09ba3ac3..a99978f8 100644 --- a/src/core/include/mp-units/core.h +++ b/src/core/include/mp-units/core.h @@ -28,6 +28,7 @@ #include #if MP_UNITS_HOSTED +#include #include #include #include diff --git a/test/static/concepts_test.cpp b/test/static/concepts_test.cpp index c79e8851..83ecfa0a 100644 --- a/test/static/concepts_test.cpp +++ b/test/static/concepts_test.cpp @@ -23,6 +23,9 @@ #include #include #include +#if MP_UNITS_HOSTED +#include +#endif #ifdef MP_UNITS_IMPORT_STD import std; #else @@ -35,12 +38,6 @@ import std; #endif #endif -#if MP_UNITS_HOSTED -template -constexpr bool mp_units::is_complex> = true; -#endif - - namespace { using namespace mp_units; diff --git a/test/static/quantity_test.cpp b/test/static/quantity_test.cpp index 16c6ab46..ba34a160 100644 --- a/test/static/quantity_test.cpp +++ b/test/static/quantity_test.cpp @@ -29,6 +29,7 @@ #include #include #if MP_UNITS_HOSTED +#include #include #endif #ifdef MP_UNITS_IMPORT_STD @@ -45,11 +46,6 @@ import std; #endif #endif -#if MP_UNITS_HOSTED -template -constexpr bool mp_units::is_complex> = true; -#endif - template<> constexpr bool mp_units::is_vector = true;