VCCC  2024.05
VisualCamp Common C++ library
bad_optional_access.h
Go to the documentation of this file.
1 # /*
2 # * Created by YongGyu Lee on 2021/05/23.
3 # */
4 #
5 # ifndef VCCC_OPTIONAL_BAD_OPTIONAL_ACCESS_H_
6 # define VCCC_OPTIONAL_BAD_OPTIONAL_ACCESS_H_
7 #
8 # include <exception>
9 
10 namespace vccc {
11 
14 
18 class bad_optional_access : public std::exception {
19  public:
20  bad_optional_access() noexcept = default;
21  bad_optional_access(const bad_optional_access&) noexcept = default;
22  bad_optional_access& operator=(const bad_optional_access&) noexcept = default;
23 
24  const char *what() const noexcept override {
25  return "bad optional access";
26  }
27 };
28 
30 
31 } // namespace vccc
32 
33 # endif // VCCC_OPTIONAL_BAD_OPTIONAL_ACCESS_H_
exception indicating checked access to an optional that doesn't contain a value
Definition: bad_optional_access.h:18
bad_optional_access() noexcept=default
const char * what() const noexcept override
Definition: bad_optional_access.h:24
Definition: directory.h:12