#`fs::current_path()` and `std::error_code` - throw or noexcept?

8 messages · Page 1 of 1 (latest)

viral herald
ivory valveBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

viral herald
proven bramble
# viral herald Basing from https://en.cppreference.com/w/cpp/filesystem/current_path (to get cu...
Exceptions

Any overload not marked noexcept may throw std::bad_alloc if memory allocation fails.
1) Throws std::filesystem::filesystem_error on underlying OS API errors, constructed with the OS error code as the error code argument.
2) Sets a std::error_code& parameter to the OS API error code if an OS API call fails, and executes ec.clear() if no errors occur.
3) Throws std::filesystem::filesystem_error on underlying OS API errors, constructed with p as the first path argument and the OS error code as the error code argument.
4) Sets a std::error_code& parameter to the OS API error code if an OS API call fails, and executes ec.clear() if no errors occur.
viral herald
#

I see but that doesnt answer my question. None of these functions with error_code are marked noexcept. In their source code they also dont throw yet they arent marked noexcept. So whats going on?

proven bramble