-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
fixedSomething works now, yay!Something works now, yay!formatC++20/23 formatC++20/23 formatthroughputMust compile fasterMust compile faster
Description
Describe the bug
The <format> header currently includes <varaint> which is a big dependency. However, std::variant itself is not used in the implementation, only std::monostate which is a trivial struct. Is it possible to move std::monostate to a common header to be used from <format> and <variant> to break the unnecessary dependency and potentially reduce compile times?
Command-line test case
C:\Temp>type test.cc
#include <format>
int main() {
auto v = std::variant<int>();
}
C:\Temp>cl /I STL/stl/inc /std:c++latest test.cc
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.29917 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
/std:c++latest is provided as a preview of language features from the latest C++
working draft, and we're eager to hear about bugs and suggestions for improvements.
However, note that these features are provided as-is without support, and subject
to changes or removal as the working draft evolves. See
https://go.microsoft.com/fwlink/?linkid=2045807 for details.
test.cc
Microsoft (R) Incremental Linker Version 14.29.29917.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
Expected behavior
The test shouldn't compile because <format> shoudn't provide std::variant.
STL version
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
fixedSomething works now, yay!Something works now, yay!formatC++20/23 formatC++20/23 formatthroughputMust compile fasterMust compile faster