Add include for std_optional in date_time.hpp#297
Closed
dwithun-dev wants to merge 1 commit intomarzer:masterfrom
Closed
Add include for std_optional in date_time.hpp#297dwithun-dev wants to merge 1 commit intomarzer:masterfrom
dwithun-dev wants to merge 1 commit intomarzer:masterfrom
Conversation
At line 337 my clang++-21 was confused where the optional came from (absel::optional? or std::optional?), i added the header and it worked for me. I installed the library from "apt", it worked for me for like a week but i don't know why my compiler started throwing me the error. /usr/include/toml++/impl/date_time.hpp:337:3: error: no template named 'optional'; did you mean 'absl::optional'? 337 | optional<toml::time_offset> offset; | ^ /usr/local/include/absl/types/optional.h:34:12: note: 'absl::optional' declared here 34 | using std::optional; | ^ 1 error generated. ninja: build stopped: subcommand failed. make: *** [Makefile:20: prof-user] Error 1
marzer
requested changes
Apr 15, 2026
| #include "forward_declarations.hpp" | ||
| #include "print_to_stream.hpp" | ||
| #include "header_start.hpp" | ||
| #include <toml++/impl/std_optional.hpp> |
Owner
There was a problem hiding this comment.
- Change the include style to match those around it (i.e. use relative paths with quotes)
- Move it one line up, above "header_start.hpp"
Owner
|
@dwithun-dev I don't understand, you closed this PR, opened a new one, then closed that too? Is there something I can help with? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At line 337 my clang++-21 was confused where the optional came from (absel::optional? or std::optional?), i added the header and it worked for me. I installed the library from "apt", it worked for me for like a week but i don't know why my compiler started throwing me the error.
/usr/include/toml++/impl/date_time.hpp:337:3: error: no template named 'optional'; did you mean 'absl::optional'? 337 | optionaltoml::time_offset offset; | ^ /usr/local/include/absl/types/optional.h:34:12: note: 'absl::optional' declared here 34 | using std::optional; | ^ 1 error generated. ninja: build stopped: subcommand failed. make: *** [Makefile:20: prof-user] Error 1
What does this change do?
Is it related to an exisiting bug report or feature request?
Pre-merge checklist
origin/master(if necessary)