Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
159 views

I'm writing a program that searches a file in Windows directory by it's name, starting from C:\. I use recursive_directory_iterator and path from std::filesystem. The problem is, while user input is ...
chrkspln's user avatar
1 vote
3 answers
419 views

Consider a custom error type written using the LLVM system_category implementation for reference: #include <iostream> #include <system_error> struct my_error_category_type : std::...
Eric's user avatar
  • 98.1k
0 votes
2 answers
925 views

I'm currently using std::error_code to give feedback to the users of my API when something goes wrong. Would it be semantically acceptable to add an std::error_condition of type warning to notify my ...
ruipacheco's user avatar
  • 16.7k
1 vote
0 answers
1k views

I tried the code from cppreference.com but it seems e.code() is not there: #include <iostream> #include <system_error> // std::make_error_condition, std::ios_errc int main () { std::cin....
towi's user avatar
  • 22.5k
6 votes
3 answers
2k views

I'm deriving my own exception, call it MyException, from std::system_error and have overridden what() to calculate and return my message. MyException's initializer list doesn't call the system_error ...
Scott Langham's user avatar
41 votes
3 answers
13k views

C++11 introduced the <system_error> header containing a generic system to handle error codes. An std::error_code is a tuple containing an int, the error code, and a reference to an std::...
moatPylon's user avatar
  • 2,201
6 votes
1 answer
2k views

There are enough error handling strategies in C++ already. We have exception handling, error return codes and this ERRNO mess. What role does the system_error header play here? How do I use the ...
Ralph Tandetzky's user avatar
61 votes
1 answer
73k views

Update in 2022 C++ 17 & 20 now have built in support for multithreading in the standard library. I would suggest using these rather than using the Linux specific pthread library. Original Question ...
user2138149's user avatar
  • 18.6k
6 votes
2 answers
2k views

I'm working on a system which is designed to use the classes called error_code, error_condition, and error_category -- a scheme newly std: in C++11, altho at the moment I'm actually using the Boost ...
Mike C's user avatar
  • 1,248