Closed mpusz closed 10 months ago
Looking at 3, a module name could be units.isq.si.length
. I should note that GCC appends to names of exported declarations in errors with @module-name
. So what before looked like
units::quantity<units::isq::si::dim_length, units::isq::si::metre, int>
would then look like
units::quantity@units<units::isq::si::dim_length@units.isq.si.length, units::isq::si::metre@units.isq.si.length, int>
Thanks for pointing that. Anyway, over time I changed my initial plans here. I do not think that Modules with granularity smaller than the entire system are a good idea. Some time ago I refactored the library's file system to represent the intended modules hierarchy. So as of now, I think that we should end up with something like:
units
├── core
├── core-fmt // possibly should be an integral part of core
├── core-io // should it be an external module because of freestanding needs?
├── isq // contains only ISQ dimensions definitions
├── si
├── si-cgs
├── si-fps
...
I still have doubts how the final tree of modules should look like so please do share your feedback, ideas, and experience.
BTW, I met with @DanielaE at NDC TechTown and she offered her help here if the time will allow this.
Related discussion https://github.com/mpusz/units/discussions/279.
For example, I am not sure if we should put si
module under isq
. I do not believe that there will be users interested in explicitly including all of the possible systems defined in terms of isq
but I can imagine a user interested only in isq
dimensions definitions to start their own system based on those. In the former case, we should provide something like units.isq.dimensions
which is counterproductive here. Also, having something like units.isq.si
does not provide any additional value as I cannot image si
being defined without isq
.
Yes, I actually did 🤦♀️ Anyway, I think I have more free time at hand after my talk and AMA at Meeting C++ next week. Then I have to find out how to compile this with VS2022 and how entangled the parts are. If everything goes only through clearly specified interfaces with no further coupling (like macros 😱) this shouldn't be too difficult (last famous words).
Other issues are core-fmt
and core-io
. Probably fmt
could be an integral part of the core
module? I defined this as a separate directory mostly for standardization purposes but in the end, it should probably land under core.
core-iois different as it is probably not welcomed in freestanding whereas the rest of the library would be great there. The old way of doing that was to use preprocessor
#ifdef` to disable iostreams support for freestanding but I do not think it is the best approach for modules as preprocessor should not be used there.
No module can look at macros defined outside the compilation of the PMI (except for given from to the compiler at its invocation)
Then I have to find out how to compile this with VS2022 and how entangled the parts are
@DanielaE, please let me know when you will have free time and we can meet online and I will guide you through the compilation on VS2022 and provide a short introduction to the framework of the library (if needed).
No module can look at macros defined outside the compilation of the PMI (except for given from to the compiler at its invocation)
@DanielaE, do you know how STD library will handle freestanding with modules? What about the types that have predefined operator<<
like std::chrono::duration
or even worse use C++ exceptions in the part of their interface (i.e. std::vector::at()
)? In this regard, I am happy that we do not use C++ exceptions here 😃
I have no clue at all. This discussion happens at the library side and I'm sitting in EWG (i.e. core language)
It seems like you intent to claim units
as the first identifier in a module-name for this library. This has the potential to clash with other libraries. Have you considered instead using mpusz.units
?
This has the potential to clash with other libraries.
Thanks for pointing this out. In the names above I assumed we are talking about potential future STD library. But this good point that for the library itself the identifier should be different. Let's go with mp-units
as this became the official name of the library.
The .
-separated identifiers in a module-name are still identifiers, so -
is not valid: https://godbolt.org/z/1fYP77r8o.
Right, what does the expression mp-units
even mean? 🤡
Mateusz, if you're attached to mp-units
(pun intended) I suggest to move from kebap-casing to snake-casing, i.e. mp_units
. The kebap-spit happens to be fallen onto the floor.
Right! 😃
Mateusz, if you're attached to mp-units (pun intended)
Well, even though one other library pretending for standardization already use wg21_
prefix I think it might be too early to call it wg21_units
. Let's stay with mp_units
for a while :wink:
@DanielaE mp-units on VS2022 is officially enabled now 😃 Please let me know if you need any assistance.
I have made some progress at https://github.com/JohelEGP/units-1/tree/modules. It depends on appending to CMAKE_MODULE_PATH
this directory: https://github.com/JohelEGP/jegp.cmake_modules/tree/master/modules.
This CMake support still has its shortcomings that I'll eventually fix. Now I'm at the point where I need to deal with bits/basic_concepts.h
and its ties to many would-be modules.
I've lost GCC (probably due to running out of source locations, or just a compound of bugs).
I've also lost Clang. symbol_text.h:93:83: instantiating function definition 'units::operator+<1UL, 1UL>'
. GCC also has problems with that. Clang outright dumps (no mention of ICE), and can't even generate preprocessed sources:
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
...
clang-15: note: diagnostic msg: Error generating preprocessed source(s).
I've opened https://github.com/llvm/llvm-project/issues/54340, https://github.com/llvm/llvm-project/issues/54457, https://github.com/llvm/llvm-project/issues/54574, https://github.com/llvm/llvm-project/issues/54590, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104993, and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105044, so far. Anything that touches the downcasting facility also has the constant expression issue of the second LLVM issue. And turning off the downcasting facility doesn't work due to bugs.
e1f7266b517c04644b666af6aef3e65216b28c56 broke GCC further. Now I'm sure that what's significantly blocking progress on GCC's modules is the modularization of ::std
.
My approach is to compile an importable header that #include
s C++ standard library headers, and export that header in a module like my.std
. In my experience, compiling the C++ standard library headers as header units breaks even earlier (in terms of the number of added headers), and just including them in the GMF also fails due to duplication.
So I'd like to know if anyone knows a better way to use the C++ standard library headers in GCC modules to unblock progress.
@DanielaE, do you have some experience with the problem described above?
Before I commence digging deeper I'd love to know if the library can be built with VS2022 and the build system used in the failed attempts (CMake I guess). Is CMake even capable of doing something meaningful with modules these days? Last time I looked it was a total desaster.
I cannot comment on anything gcc or clang-specific. My machine is running VS2022 on Windows - no Linux with a working development environment. AFAIK, the current state of gcc and clang is so poor that I wouldn't even bother to install a dev environment in WSL on my own. If someone is willing to baby-step me there such that I can see the same failures as above, I might spend some of my meager spare time on that.
And I don't understand what an importable header of the C++ standard library should buy here. I've experimentally done that for my last year's talks on modules and found this to be particularily hard and mostly not worth the effort. Without #include-translation you have to do a lot of preprocessor gymnastics to even be able to use something like my.std
. And @JohelEGP please be aware that a header unit requires the same level of maturity of the implementation of modules as named modules. In fact it is putting considerably more burden onto the compiler in the import phase due to the sheer amount of definition merging required at that point: the compiler has to merge everything, possibly multiple times, instead of just the interface of the library.
Before I commence digging deeper I'd love to know if the library can be built with VS2022 and the build system used in the failed attempts (CMake I guess).
No, it only supports Clang and GCC.
@DanielaE, @JohelEGP has issues with C++ modules on Clang and GCC as described above. However, the library compiles just fine on VS2022 (but without using modules). You can find all the information here: https://mpusz.github.io/units/usage.html. In case you will have any issues please let me know. We can also meet online to get you started.
This CMake support still has its shortcomings that I'll eventually fix.
-This CMake support still has its shortcomings that I'll eventually fix. +This CMake support still has its shortcomings that I'll eventually fix and document.
An important one is that only the Unix Makefiles generator is supported because Ninja wasn't usable, and I haven't tried out the supposedly fixed Ninja 1.10. Edit: Now it supports the Ninja. GCC is blocked on https://github.com/ninja-build/ninja/issues/1962. Edit: And limitations have been documented: https://github.com/JohelEGP/jegp.cmake_modules/#limitations.
@mpusz a short feedback: I'm still at step
conan install .. -pr <your_conan_profile> -s compiler.cppstd=20 -e mp-units:CONAN_RUN_TESTS=True -b outdated -u
The troublemaker is the dependency xapian-core
(what is it needed for?). It requires msys64 and this is where the hell breaks loose. Be it msys or cygwin, both of them are just a shit-show as Victor loves to call things. It's 2022 and these fake-unixoid environments still haven't learned to deal with ASLR in any sensible way. And I have no intention to reduce system security because of that.
@DanielaE please try:
conan install .. -pr <your_conan_profile> -s compiler.cppstd=20 -e mp-units:CONAN_RUN_TESTS=True -o build_docs=False -b outdated -u
so the doxygen dependencies are not installed. It should help on Windows.
Thanks - this helps! 😊
After fixing a problem with {fmt} there's progress - kind of. I experience a couple of compiler errors when running conan build ..
:
----Running------
> cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="E:/mp-units/build/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="E:/mp-units/build/package" "E:\mp-units"
-----------------
-- Using Conan toolchain: E:/mp-units/build/conan_toolchain.cmake
-- Conan toolchain: C++ Standard 20 with extensions OFF
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19044.
-- Enabling ccache
-- ccache support not enabled: unsupported generator 'Visual Studio 17 2022'
-- Enabling ccache - failed
-- Setting restrictive compilation warnings
-- Treat warnings as errors: ON
-- Flags: /W4;/w14062;/w14242;/w14254;/w14263;/w14265;/w14266;/w14287;/we4289;/w14296;/w14311;/w14545;/w14546;/w14547;/w14549;/w14555;/w14619;/w14640;/w14826;/w14905;/w14906;/w14928;/permissive-;/WX
-- Setting restrictive compilation warnings - done
-- UNITS_AS_SYSTEM_HEADERS: OFF
-- Conan: Component target declared 'gsl::gsl-lite'
-- UNITS_DOWNCAST_MODE: ON
-- UNITS_USE_LIBFMT: ON
-- Conan: Target declared 'fmt::fmt'
-- Conan: Target declared 'wg21_linear_algebra::wg21_linear_algebra'
-- Conan: Component target declared 'mdspan::_mdspan'
-- Conan: Target declared 'mdspan::mdspan'
-- Conan: Target declared 'wg21_linear_algebra::wg21_linear_algebra'
-- Conan: Component target declared 'mdspan::_mdspan'
-- Conan: Target declared 'mdspan::mdspan'
-- Conan: Target declared 'wg21_linear_algebra::wg21_linear_algebra'
-- Conan: Component target declared 'mdspan::_mdspan'
-- Conan: Target declared 'mdspan::mdspan'
-- UNITS_BUILD_DOCS: OFF
-- Conan: Target declared 'Catch2::Catch2'
-- Configuring done
-- Generating done
-- Build files have been written to: E:/mp-units/build
----Running------
> cmake --build E:\mp-units\build --config Release
-----------------
Microsoft (R)-Build-Engine, Version 17.2.0-preview-22116-01+7d926d7ab fr .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
avg_speed-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\avg_speed-aliases.exe
avg_speed-literals.vcxproj -> E:\mp-units\build\example\literals\Release\avg_speed-literals.exe
avg_speed-references.vcxproj -> E:\mp-units\build\example\references\Release\avg_speed-references.exe
box_example.cpp
box_example-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\box_example-aliases.exe
box_example.cpp
box_example-literals.vcxproj -> E:\mp-units\build\example\literals\Release\box_example-literals.exe
box_example.cpp
E:\mp-units\src\core\include\units/bits/basic_concepts.h(166,1): error C2872: 'dim_speed': ambiguous symbol [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\systems\isq\include\units/isq/dimensions/speed.h(32,8): message : could be 'units::isq::dim_speed' [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/speed.h(38,8): message : or 'units::isq::si::dim_speed' [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(184): message : see reference to function template instantiation 'auto units::detail::default_unit<units::isq::si::dim_speed>(void)' being compiled [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/reference.h(46): message : see reference to alias template instantiation 'units::dimension_unit<units::isq::si::dim_speed>' being compiled [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/reference.h(57): message : see reference to alias template instantiation 'units::detail::reference_divide_impl<units::isq::si::dim_speed,D,U,units::isq::si::dim_time,units::isq::si::second>' being compiled [E:\mp-units\build\example\references\box_example-references.vcxproj]
with
[
D=units::isq::si::dim_length,
U=units::isq::si::metre
]
E:\mp-units\src\core\include\units/reference.h(114): message : see reference to alias template instantiation 'units::reference_divide<units::reference<units::isq::si::dim_length,units::isq::si::metre>,units::reference<units::isq::si::dim_time,units::isq::si::second>>' being compiled [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/reference.h(114): message : see reference to function template instantiation 'units::reference<detail::dimension_multiply_impl<D,detail::dim_invert_impl<R2::dimension>::type>::type,decltype(<expr>)::type> units::operator /(units::reference<D,units::isq::si::metre>,R2)' being compiled [E:\mp-units\build\example\references\box_example-references.vcxproj]
with
[
D=units::isq::si::dim_length
]
E:\mp-units\example\references\box_example.cpp(100): message : see reference to function template instantiation 'auto units::operator /<units::quantity<units::isq::si::dim_length,units::isq::si::metre,double>,units::quantity<D,U,Rep>>(const Q1 &,const Q2 &)' being compiled [E:\mp-units\build\example\references\box_example-references.vcxproj]
with
[
D=units::isq::si::dim_time,
U=units::isq::si::second,
Rep=double,
Q1=units::quantity<units::isq::si::dim_length,units::isq::si::metre,double>,
Q2=units::quantity<units::isq::si::dim_time,units::isq::si::second,double>
]
E:\mp-units\src\core\include\units/quantity.h(485,46): error C2676: binary '/': 'const units::reference<units::isq::si::dim_length,units::isq::si::metre>' does not define this operator or a conversion to a type acceptable to the predefined operator [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/quantity.h(483): error C7601: the associated constraints are not satisfied [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/quantity.h(45,19): error C2651: 'int': left of '::' must be a class, struct or union [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/quantity.h(483): message : see reference to function template instantiation 'auto units::detail::?$make_quantity@$MH0A@::<lambda_12>::operator ()<double>(_T1 &&) const' being compiled [E:\mp-units\build\example\references\box_example-references.vcxproj]
with
[
_T1=double
]
E:\mp-units\src\core\include\units/quantity.h(46): error C2062: type 'unknown-type' unexpected [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/quantity.h(45,41): error C2039: 'dimension': is not a member of '`global namespace'' [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/quantity.h(45,52): error C2651: 'int': left of '::' must be a class, struct or union [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/quantity.h(45,74): error C2039: 'unit': is not a member of '`global namespace'' [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\src\core\include\units/quantity.h(485,62): error C7601: the associated constraints are not satisfied [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\example\references\box_example.cpp(100,36): error C7601: the associated constraints are not satisfied [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\example\references\box_example.cpp(100,60): error C3313: 'float_rise_rate': variable cannot have the type 'const void' [E:\mp-units\build\example\references\box_example-references.vcxproj]
E:\mp-units\example\references\box_example.cpp(107,73): error C3536: 'float_rise_rate': cannot be used before it is initialized [E:\mp-units\build\example\references\box_example-references.vcxproj]
capacitor_time_curve-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\capacitor_time_curve-aliases.exe
capacitor_time_curve-literals.vcxproj -> E:\mp-units\build\example\literals\Release\capacitor_time_curve-literals.exe
capacitor_time_curve-references.vcxproj -> E:\mp-units\build\example\references\Release\capacitor_time_curve-references.exe
clcpp_response.cpp
clcpp_response-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\clcpp_response-aliases.exe
clcpp_response.cpp
clcpp_response-literals.vcxproj -> E:\mp-units\build\example\literals\Release\clcpp_response-literals.exe
clcpp_response.cpp
clcpp_response-references.vcxproj -> E:\mp-units\build\example\references\Release\clcpp_response-references.exe
conversion_factor.cpp
conversion_factor.vcxproj -> E:\mp-units\build\example\Release\conversion_factor.exe
custom_systems.vcxproj -> E:\mp-units\build\example\Release\custom_systems.exe
experimental_angle-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\experimental_angle-aliases.exe
experimental_angle-literals.vcxproj -> E:\mp-units\build\example\literals\Release\experimental_angle-literals.exe
experimental_angle-references.vcxproj -> E:\mp-units\build\example\references\Release\experimental_angle-references.exe
foot_pound_second.cpp
foot_pound_second-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\foot_pound_second-aliases.exe
foot_pound_second.cpp
foot_pound_second-literals.vcxproj -> E:\mp-units\build\example\literals\Release\foot_pound_second-literals.exe
foot_pound_second.cpp
foot_pound_second-references.vcxproj -> E:\mp-units\build\example\references\Release\foot_pound_second-references.exe
geographic.cpp
glide_computer.cpp
glide_computer.vcxproj -> E:\mp-units\build\example\glide_computer\Release\glide_computer.lib
Building Custom Rule E:/mp-units/example/aliases/CMakeLists.txt
glide_computer_example.cpp
glide_computer_example-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\glide_computer_example-aliases.exe
Building Custom Rule E:/mp-units/example/literals/CMakeLists.txt
glide_computer_example.cpp
glide_computer_example-literals.vcxproj -> E:\mp-units\build\example\literals\Release\glide_computer_example-literals.exe
Building Custom Rule E:/mp-units/example/references/CMakeLists.txt
glide_computer_example.cpp
glide_computer_example-references.vcxproj -> E:\mp-units\build\example\references\Release\glide_computer_example-references.exe
hello_units.cpp
hello_units.vcxproj -> E:\mp-units\build\example\Release\hello_units.exe
kalman_filter-example_1.cpp
kalman_filter-example_1.vcxproj -> E:\mp-units\build\example\kalman_filter\Release\kalman_filter-example_1.exe
kalman_filter-example_2.cpp
kalman_filter-example_2.vcxproj -> E:\mp-units\build\example\kalman_filter\Release\kalman_filter-example_2.exe
kalman_filter-example_3.cpp
kalman_filter-example_3.vcxproj -> E:\mp-units\build\example\kalman_filter\Release\kalman_filter-example_3.exe
kalman_filter-example_4.cpp
kalman_filter-example_4.vcxproj -> E:\mp-units\build\example\kalman_filter\Release\kalman_filter-example_4.exe
kalman_filter-example_5.cpp
kalman_filter-example_5.vcxproj -> E:\mp-units\build\example\kalman_filter\Release\kalman_filter-example_5.exe
kalman_filter-example_6.cpp
kalman_filter-example_6.vcxproj -> E:\mp-units\build\example\kalman_filter\Release\kalman_filter-example_6.exe
kalman_filter-example_7.cpp
kalman_filter-example_7.vcxproj -> E:\mp-units\build\example\kalman_filter\Release\kalman_filter-example_7.exe
kalman_filter-example_8.cpp
kalman_filter-example_8.vcxproj -> E:\mp-units\build\example\kalman_filter\Release\kalman_filter-example_8.exe
linear_algebra.cpp
linear_algebra-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\linear_algebra-aliases.exe
linear_algebra.cpp
linear_algebra-literals.vcxproj -> E:\mp-units\build\example\literals\Release\linear_algebra-literals.exe
linear_algebra.cpp
linear_algebra-references.vcxproj -> E:\mp-units\build\example\references\Release\linear_algebra-references.exe
measurement.vcxproj -> E:\mp-units\build\example\Release\measurement.exe
measurement-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\measurement-aliases.exe
total_energy-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\total_energy-aliases.exe
total_energy.cpp
E:\mp-units\src\core\include\units/bits/basic_concepts.h(166,1): error C2872: 'dim_speed': ambiguous symbol [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq\include\units/isq/dimensions/speed.h(32,8): message : could be 'units::isq::dim_speed' [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/speed.h(39,8): message : or 'units::isq::natural::dim_speed' [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(184): message : see reference to function template instantiation 'auto units::detail::default_unit<units::isq::natural::dim_speed>(void)' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(203): message : see reference to alias template instantiation 'units::dimension_unit<units::isq::natural::dim_speed>' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/speed.h(41): message : see reference to variable template 'bool UnitOf<units::one,units::isq::natural::dim_speed>' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(80): message : see reference to variable template 'const auto speed_of_light<double>' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/constants.h(30,1): error C7602: 'units::isq::natural::speed': the associated constraints are not satisfied [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/speed.h(42): message : see declaration of 'units::isq::natural::speed' [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/constants.h(30): error C2062: type 'unknown-type' unexpected [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(80,43): error C3376: 'units::isq::natural::speed_of_light': only static data member templates are allowed [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(80): error C2062: type 'unknown-type' unexpected [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(166,1): error C2872: 'dim_momentum': ambiguous symbol [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq\include\units/isq/dimensions/momentum.h(31,8): message : could be 'units::isq::dim_momentum' [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/momentum.h(38,8): message : or 'units::isq::natural::dim_momentum' [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(184): message : see reference to function template instantiation 'auto units::detail::default_unit<units::isq::natural::dim_momentum>(void)' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(203): message : see reference to alias template instantiation 'units::dimension_unit<units::isq::natural::dim_momentum>' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/momentum.h(40): message : see reference to variable template 'bool UnitOf<units::isq::natural::gigaelectronvolt,units::isq::natural::dim_momentum>' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(81,34): error C7602: 'units::isq::natural::momentum': the associated constraints are not satisfied [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/momentum.h(41): message : see declaration of 'units::isq::natural::momentum' [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(81,34): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(81): error C2062: type 'unknown-type' unexpected [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(166,1): error C2872: 'dim_mass': ambiguous symbol [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq\include\units/isq/dimensions/mass.h(30,1): message : could be 'units::isq::dim_mass' [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/mass.h(35,8): message : or 'units::isq::natural::dim_mass' [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(184): message : see reference to function template instantiation 'auto units::detail::default_unit<units::isq::natural::dim_mass>(void)' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(203): message : see reference to alias template instantiation 'units::dimension_unit<units::isq::natural::dim_mass>' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/mass.h(37): message : see reference to variable template 'bool UnitOf<units::isq::natural::gigaelectronvolt,units::isq::natural::dim_mass>' being compiled [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(82,30): error C7602: 'units::isq::natural::mass': the associated constraints are not satisfied [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\src\systems\isq-natural\include\units/isq/natural/mass.h(38): message : see declaration of 'units::isq::natural::mass' [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(82,30): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(82): error C2062: type 'unknown-type' unexpected [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(83,38): error C2065: 'p': undeclared identifier [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(83,41): error C2065: 'm': undeclared identifier [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(83,45): error C3536: 'c': cannot be used before it is initialized [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(83,21): error C2737: 'E': const object must be initialized [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(86,26): error C2065: 'p': undeclared identifier [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(87,26): error C2065: 'm': undeclared identifier [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
E:\mp-units\example\literals\total_energy.cpp(88,28): error C3536: 'E': cannot be used before it is initialized [E:\mp-units\build\example\literals\total_energy-literals.vcxproj]
total_energy.cpp
E:\mp-units\src\core\include\units/bits/basic_concepts.h(166,1): error C2872: 'dim_speed': ambiguous symbol [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\isq\include\units/isq/dimensions/speed.h(32,8): message : could be 'units::isq::dim_speed' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/speed.h(38,8): message : or 'units::isq::si::dim_speed' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(184): message : see reference to function template instantiation 'auto units::detail::default_unit<units::isq::si::dim_speed>(void)' being compiled [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(203): message : see reference to alias template instantiation 'units::dimension_unit<units::isq::si::dim_speed>' being compiled [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/speed.h(42): message : see reference to variable template 'bool UnitOf<units::isq::si::metre_per_second,units::isq::si::dim_speed>' being compiled [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(48): message : see reference to variable template 'const auto speed_of_light<double>' being compiled [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/constants.h(51,1): error C7602: 'units::isq::si::speed': the associated constraints are not satisfied [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/speed.h(43): message : see declaration of 'units::isq::si::speed' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/constants.h(51): error C2062: type 'unknown-type' unexpected [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(48,51): error C3376: 'units::isq::si::si2019::speed_of_light': only static data member templates are allowed [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(48): error C2062: type 'unknown-type' unexpected [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(50,44): error C3536: 'c': cannot be used before it is initialized [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(52,25): error C7601: the associated constraints are not satisfied [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(53,34): error C2672: 'pow': no matching overloaded function found [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(53,38): error C2974: 'pow': invalid template argument for '_Ty1', type expected [E:\mp-units\build\example\references\total_energy-references.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.32.31302\include\cmath(669): message : see declaration of 'pow' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(53,19): error C2737: 'm': const object must be initialized [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(54,42): error C3536: 'm': cannot be used before it is initialized [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(54,25): error C2672: 'total_energy': no matching overloaded function found [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(54,45): error C7602: '`anonymous-namespace'::total_energy': the associated constraints are not satisfied [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(38): message : see declaration of '`anonymous-namespace'::total_energy' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(54,21): error C2737: 'E': const object must be initialized [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(59,28): error C3536: 'E': cannot be used before it is initialized [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(166,1): error C2872: 'dim_momentum': ambiguous symbol [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\isq\include\units/isq/dimensions/momentum.h(31,8): message : could be 'units::isq::dim_momentum' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/momentum.h(38,8): message : or 'units::isq::si::dim_momentum' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(184): message : see reference to function template instantiation 'auto units::detail::default_unit<units::isq::si::dim_momentum>(void)' being compiled [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\core\include\units/bits/basic_concepts.h(203): message : see reference to alias template instantiation 'units::dimension_unit<units::isq::si::dim_momentum>' being compiled [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/momentum.h(40): message : see reference to variable template 'bool UnitOf<units::isq::si::kilogram_metre_per_second,units::isq::si::dim_momentum>' being compiled [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(61,43): error C7602: 'units::isq::si::momentum': the associated constraints are not satisfied [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/momentum.h(41): message : see declaration of 'units::isq::si::momentum' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(61,43): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(61): error C2062: type 'unknown-type' unexpected [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(62,32): error C2440: 'initializing': cannot convert from 'int' to 'units::quantity<units::isq::si::dim_mass,units::isq::si::kilogram,double>' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(62,32): message : Constructor for class 'units::quantity<units::isq::si::dim_mass,units::isq::si::kilogram,double>' is declared 'explicit' [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(63,43): error C2065: 'p_si': undeclared identifier [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(63,23): error C2737: 'E_si': const object must be initialized [E:\mp-units\build\example\references\total_energy-references.vcxproj]
E:\mp-units\example\references\total_energy.cpp(66,26): error C2065: 'p_si': undeclared identifier [E:\mp-units\build\example\references\total_energy-references.vcxproj]
fmt_test.cpp
fmt_units_test.cpp
E:\mp-units\src\core\include\units/bits/derived_symbol_text.h(85,1): error C2872: 'dim_surface_tension': ambiguous symbol (compiling source file E:\mp-units\test\unit_test\runtime\fmt_test.cpp) [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
E:\mp-units\src\systems\isq\include\units/isq/dimensions/surface_tension.h(32,8): message : could be 'units::isq::dim_surface_tension' (compiling source file E:\mp-units\test\unit_test\runtime\fmt_test.cpp) [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
E:\mp-units\src\systems\si\include\units/isq/si/surface_tension.h(38,8): message : or 'units::isq::si::dim_surface_tension' (compiling source file E:\mp-units\test\unit_test\runtime\fmt_test.cpp) [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
E:\mp-units\src\core\include\units/unit.h(160): message : see reference to function template instantiation 'auto units::detail::derived_symbol_text<Dim,U,units::isq::si::centimetre>(void)' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
with
[
Dim=units::isq::si::dim_surface_tension,
U=units::isq::si::newton
] (compiling source file E:\mp-units\test\unit_test\runtime\fmt_test.cpp)
E:\mp-units\test\unit_test\runtime\fmt_test.cpp(192): message : see reference to class template instantiation 'units::derived_unit<____C_A_T_C_H____T_E_S_T____0::newton_per_centimetre,units::isq::si::dim_surface_tension,units::isq::si::newton,units::isq::si::centimetre>' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
E:\mp-units\src\core\include\units/bits/unit_text.h(142,1): error C2872: 'fathom': ambiguous symbol (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp) [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
E:\mp-units\src\systems\si-international\include\units/isq/si/international/length.h(47,8): message : could be 'units::isq::si::international::fathom' (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp) [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
E:\mp-units\src\systems\si-uscs\include\units/isq/si/uscs/length.h(42,8): message : or 'units::isq::si::uscs::fathom' (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp) [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
E:\mp-units\src\core-fmt\include\units/format.h(416): message : see reference to function template instantiation 'auto units::detail::unit_text<Dimension,Unit>(void)' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
with
[
Dimension=units::isq::si::dim_length,
Unit=units::isq::si::international::fathom
] (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp)
E:\mp-units\src\core-fmt\include\units/format.h(451): message : see reference to function template instantiation 'OutputIt fmt::v8::formatter<units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>,char,void>::format_quantity_content<OutputIt,FormatContext>(OutputIt,const units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t> &,FormatContext &)' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
with
[
OutputIt=fmt::v8::appender,
FormatContext=context
] (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp)
E:\mp-units\src\core-fmt\include\units/format.h(451): message : see reference to function template instantiation 'OutputIt fmt::v8::formatter<units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>,char,void>::format_quantity_content<OutputIt,FormatContext>(OutputIt,const units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t> &,FormatContext &)' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
with
[
OutputIt=fmt::v8::appender,
FormatContext=context
] (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp)
C:\Users\Daniela Engert\.conan\data\fmt\8.1.1\_\_\package\90f2cd62afd916ec8c67e719700220ea58131a86\include\fmt\core.h(731): message : see reference to function template instantiation 'OutputIt fmt::v8::formatter<units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>,char,void>::format<Context>(const units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t> &,FormatContext &)' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
with
[
OutputIt=fmt::v8::appender,
Context=context,
FormatContext=context
] (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp)
C:\Users\Daniela Engert\.conan\data\fmt\8.1.1\_\_\package\90f2cd62afd916ec8c67e719700220ea58131a86\include\fmt\core.h(1451): message : see reference to function template instantiation 'bool fmt::v8::detail::has_const_formatter<U,Context>(void)' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
with
[
U=units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>,
Context=context
] (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp)
C:\Users\Daniela Engert\.conan\data\fmt\8.1.1\_\_\package\90f2cd62afd916ec8c67e719700220ea58131a86\include\fmt\core.h(1477): message : see reference to class template instantiation 'fmt::v8::detail::arg_mapper<context>::formattable<const units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t> &,units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>>' being compiled (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp) [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
C:\Users\Daniela Engert\.conan\data\fmt\8.1.1\_\_\package\90f2cd62afd916ec8c67e719700220ea58131a86\include\fmt\core.h(1688): message : see reference to alias template instantiation 'fmt::v8::detail::mapped_type_constant<units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>,Context>' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
with
[
Context=fmt::v8::format_context
] (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp)
C:\Users\Daniela Engert\.conan\data\fmt\8.1.1\_\_\package\90f2cd62afd916ec8c67e719700220ea58131a86\include\fmt\core.h(1844): message : see reference to function template instantiation 'unsigned __int64 fmt::v8::detail::encode_types<Context,units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>,>(void)' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
with
[
Context=fmt::v8::format_context
] (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp)
C:\Users\Daniela Engert\.conan\data\fmt\8.1.1\_\_\package\90f2cd62afd916ec8c67e719700220ea58131a86\include\fmt\core.h(3118): message : see reference to class template instantiation 'fmt::v8::format_arg_store<fmt::v8::format_context,units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>>' being compiled (compiling source file E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp) [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
E:\mp-units\test\unit_test\runtime\fmt_units_test.cpp(64): message : see reference to function template instantiation 'std::string fmt::v8::format<units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>>(fmt::v8::basic_format_string<char,units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t>>,units::quantity<units::isq::si::dim_length,units::isq::si::international::fathom,int64_t> &&)' being compiled [E:\mp-units\build\test\unit_test\runtime\unit_tests_runtime.vcxproj]
quantity_kind_test.cpp
quantity_point_kind_test.cpp
E:\mp-units\src\core\include\units/quantity.h(138,1): error C2220: the following warning is treated as an error (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp) [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
E:\mp-units\src\core\include\units/quantity_kind.h(101): message : see reference to function template instantiation 'units::quantity<units::dim_one,U,Rep>::quantity<int&>(Value)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
U=units::one,
Rep=short,
Value=int &
] (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp)
E:\mp-units\src\core\include\units/quantity_kind.h(100): message : see reference to function template instantiation 'units::quantity<units::dim_one,U,Rep>::quantity<int&>(Value)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
U=units::one,
Rep=short,
Value=int &
] (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp)
E:\mp-units\src\core\include\units/quantity_point_kind.h(67): message : see reference to function template instantiation 'units::quantity_kind<`anonymous-namespace'::apple,U,Rep>::quantity_kind<int&>(T)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
U=units::one,
Rep=short,
T=int &
] (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp)
E:\mp-units\src\core\include\units/quantity_point_kind.h(66): message : see reference to function template instantiation 'units::quantity_kind<`anonymous-namespace'::apple,U,Rep>::quantity_kind<int&>(T)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
U=units::one,
Rep=short,
T=int &
] (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp)
E:\mp-units\test\unit_test\static\test_tools.h(79): message : see reference to function template instantiation 'units::quantity_point_kind<`anonymous-namespace'::nth_apple_kind,units::one,short>::quantity_point_kind<int&>(T)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
T=int &
] (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp)
E:\mp-units\test\unit_test\static\test_tools.h(80): message : see reference to function template instantiation 'units::quantity_point_kind<`anonymous-namespace'::nth_apple_kind,units::one,short>::quantity_point_kind<int&>(T)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
T=int &
] (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp)
E:\mp-units\test\unit_test\static\test_tools.h(105): message : see reference to function template instantiation 'T construct_from<units::quantity_point_kind<`anonymous-namespace'::nth_apple_kind,units::one,short>,int>(int)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
T=units::quantity_point_kind<`anonymous-namespace'::nth_apple_kind,units::one,short>
] (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp)
E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp(265): message : see reference to function template instantiation 'T construct_from_only<units::quantity_point_kind<`anonymous-namespace'::nth_apple_kind,units::one,short>,int>(int)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
T=units::quantity_point_kind<`anonymous-namespace'::nth_apple_kind,units::one,short>
]
E:\mp-units\test\unit_test\static\test_tools.h(106,10): message : while evaluating constexpr function 'construct_from' (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp) [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp(265,15): message : while evaluating constexpr function 'construct_from_only' [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
E:\mp-units\src\core\include\units/quantity.h(138,1): warning C4242: 'initializing': conversion from 'int' to 'Rep', possible loss of data [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
Rep=short
] (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp)
E:\mp-units\test\unit_test\static\test_tools.h(106,10): message : while evaluating constexpr function 'construct_from' (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp) [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp(265,15): message : while evaluating constexpr function 'construct_from_only' [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
E:\mp-units\src\core\include\units/quantity.h(138,1): warning C4242: 'initializing': conversion from '_Ty' to 'Rep', possible loss of data [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
_Ty=int
]
and
[
Rep=short
] (compiling source file E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp)
E:\mp-units\test\unit_test\static\quantity_point_kind_test.cpp(265): message : see reference to function template instantiation 'units::quantity<units::dim_one,U,Rep>::quantity<int>(Value &&)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
U=units::one,
Rep=short,
Value=int
]
E:\mp-units\src\core\include\units/quantity.h(138,1): error C2220: the following warning is treated as an error (compiling source file E:\mp-units\test\unit_test\static\quantity_kind_test.cpp) [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
E:\mp-units\test\unit_test\static\quantity_kind_test.cpp(273): message : see reference to function template instantiation 'units::quantity<units::dim_one,units::one,short>::quantity<int>(Value &&)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
Value=int
]
E:\mp-units\src\core\include\units/quantity.h(138,1): warning C4242: 'initializing': conversion from '_Ty' to 'Rep', possible loss of data [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
_Ty=int
]
and
[
Rep=short
] (compiling source file E:\mp-units\test\unit_test\static\quantity_kind_test.cpp)
E:\mp-units\src\core\include\units/quantity.h(138,1): warning C4242: 'initializing': conversion from '_Ty' to 'Rep', possible loss of data [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
_Ty=int
]
and
[
Rep=uint8_t
] (compiling source file E:\mp-units\test\unit_test\static\quantity_kind_test.cpp)
E:\mp-units\src\core\include\units/quantity_kind.h(101): message : see reference to function template instantiation 'units::quantity<units::dim_one,U,Rep>::quantity<int>(Value &&)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
U=units::one,
Rep=uint8_t,
Value=int
] (compiling source file E:\mp-units\test\unit_test\static\quantity_kind_test.cpp)
E:\mp-units\src\core\include\units/quantity_kind.h(100): message : see reference to function template instantiation 'units::quantity<units::dim_one,U,Rep>::quantity<int>(Value &&)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
U=units::one,
Rep=uint8_t,
Value=int
] (compiling source file E:\mp-units\test\unit_test\static\quantity_kind_test.cpp)
E:\mp-units\test\unit_test\static\quantity_kind_test.cpp(429): message : see reference to function template instantiation 'units::quantity_kind<units::detail::_kind_base<K,units::dim_one>,units::one,uint8_t>::quantity_kind<int>(T &&)' being compiled [E:\mp-units\build\test\unit_test\static\unit_tests_static_truncating.vcxproj]
with
[
K=`anonymous-namespace'::width_kind,
T=int
]
unknown_dimension-aliases.vcxproj -> E:\mp-units\build\example\aliases\Release\unknown_dimension-aliases.exe
unknown_dimension-literals.vcxproj -> E:\mp-units\build\example\literals\Release\unknown_dimension-literals.exe
unknown_dimension-references.vcxproj -> E:\mp-units\build\example\references\Release\unknown_dimension-references.exe
I must admit I never used VS generator (always Ninja) but it seems it works nearly OK for me. The only problem I see is that VS generator seems to not work with generator expressions for target_compile_options()
so the /wd4242
is not applied correctly to truncating unit tests. In such a case it is recommended to comment them out here:
This is my vs2022
Conan profile file:
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=msvc
compiler.version=193
compiler.cppstd=23
compiler.runtime=static
build_type=Release
[options]
[build_requires]
[env]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
and this is how I run it:
mkdir build
cd build
conan install ../.. -pr vs2022 -e CONAN_RUN_TESTS=True -o build_docs=False
cmake ../.. --toolchain conan_toolchain.cmake -G "Visual Studio 17 2022"
cmake --build . --config Release
I am on the latest VS2022 version (with all updates).
Modules:
Framework types that should not be explicitly used by the user (i.e.
dimension
,unit
) should be private in a module and only a helper interface should be publicly exposed to the user.