|
y3c-stl 0.4.0
Friendly C++ STL wrapper with automatic stacktrace
|
Namespaces | |
| namespace | type_name |
| namespace | what |
Classes | |
| class | contiguous_iterator |
| array, vector など各種コンテナのイテレータ More... | |
| class | exception_base |
| y3cの例外クラスのベース。 More... | |
| class | life |
| オブジェクトのライフタイムを管理するクラス More... | |
| class | life_observer |
| ライフタイムの状態を観測するクラス More... | |
| class | life_state |
| struct | life_validator |
| struct | skip_trace_tag |
| struct | terminate_detail |
| class | ub_access_deleted |
| class | ub_access_nullptr |
| class | ub_invalid_iter |
| class | ub_iter_after_end |
| class | ub_iter_before_begin |
| class | ub_out_of_range |
| class | ub_wrong_iter |
Enumerations | |
| enum class | terminate_type { exception , terminate , internal , ub_out_of_range , ub_access_nullptr , ub_access_deleted , ub_wrong_iter , ub_invalid_iter , ub_iter_after_end , ub_iter_before_begin } |
Functions | |
| template<typename element_type > | |
| element_type * | unwrap (const contiguous_iterator< element_type > &wrapper) noexcept |
| template<typename T > | |
| bool | operator== (const contiguous_iterator< T > &lhs, const contiguous_iterator< T > &rhs) |
| template<typename T > | |
| bool | operator!= (const contiguous_iterator< T > &lhs, const contiguous_iterator< T > &rhs) |
| template<typename T > | |
| bool | operator< (const contiguous_iterator< T > &lhs, const contiguous_iterator< T > &rhs) |
| template<typename T > | |
| bool | operator> (const contiguous_iterator< T > &lhs, const contiguous_iterator< T > &rhs) |
| template<typename T > | |
| bool | operator<= (const contiguous_iterator< T > &lhs, const contiguous_iterator< T > &rhs) |
| template<typename T > | |
| bool | operator>= (const contiguous_iterator< T > &lhs, const contiguous_iterator< T > &rhs) |
| void | link () noexcept |
| void | handle_final_terminate_message () noexcept |
| void | do_terminate_with (terminate_detail &&detail) |
| 例外を表示して強制終了する | |
| template<typename... Args, typename = skip_trace_tag> | |
| void | terminate_ub_out_of_range (std::string func, Args &&...args) |
| template<typename... Args, typename = skip_trace_tag> | |
| void | terminate_ub_access_nullptr (std::string func, Args &&...args) |
| template<typename... Args, typename = skip_trace_tag> | |
| void | terminate_ub_access_deleted (std::string func, Args &&...args) |
| template<typename... Args, typename = skip_trace_tag> | |
| void | terminate_ub_wrong_iter (std::string func, Args &&...args) |
| template<typename... Args, typename = skip_trace_tag> | |
| void | terminate_ub_invalid_iter (std::string func, Args &&...args) |
| template<typename... Args, typename = skip_trace_tag> | |
| void | terminate_ub_iter_after_end (std::string func, Args &&...args) |
| template<typename... Args, typename = skip_trace_tag> | |
| void | terminate_ub_iter_before_begin (std::string func, Args &&...args) |
| void | terminate_internal (std::string func, std::string what, skip_trace_tag={}) |
| template<typename T > | |
| const std::string & | get_type_name () |
| void | strip_and_print_trace (std::ostream &stream, cpptrace::stacktrace &trace) |
| void | print_header (std::ostream &stream) |
| void | print_what (std::ostream &stream, const char *func, const char *what, bool quote=false) |
| void | print_maybe_inaccurate (std::ostream &stream) |
| void | print_y3c_exception (std::ostream &stream, const terminate_detail &e) |
| void | print_current_exception (std::ostream &stream, std::exception_ptr current, skip_trace_tag={}) |
Variables | |
| bool | throw_on_terminate |
|
strong |
| void do_terminate_with | ( | terminate_detail && | detail | ) |
例外を表示して強制終了する
内部ではstd::terminate()ではなくstd::abort()を呼んでいる
| const std::string & get_type_name | ( | ) |
|
noexcept |
これが std::set_terminate() に自動的に登録され、 例外がcatchされずterminateした時にメッセージを出してくれる。
|
noexcept |
| bool operator!= | ( | const contiguous_iterator< T > & | lhs, |
| const contiguous_iterator< T > & | rhs | ||
| ) |
| bool operator< | ( | const contiguous_iterator< T > & | lhs, |
| const contiguous_iterator< T > & | rhs | ||
| ) |
| bool operator<= | ( | const contiguous_iterator< T > & | lhs, |
| const contiguous_iterator< T > & | rhs | ||
| ) |
| bool operator== | ( | const contiguous_iterator< T > & | lhs, |
| const contiguous_iterator< T > & | rhs | ||
| ) |
| bool operator> | ( | const contiguous_iterator< T > & | lhs, |
| const contiguous_iterator< T > & | rhs | ||
| ) |
| bool operator>= | ( | const contiguous_iterator< T > & | lhs, |
| const contiguous_iterator< T > & | rhs | ||
| ) |
| void print_current_exception | ( | std::ostream & | stream, |
| std::exception_ptr | current, | ||
| skip_trace_tag | = {} |
||
| ) |
| void print_header | ( | std::ostream & | stream | ) |
| void print_maybe_inaccurate | ( | std::ostream & | stream | ) |
| void print_what | ( | std::ostream & | stream, |
| const char * | func, | ||
| const char * | what, | ||
| bool | quote = false |
||
| ) |
| void print_y3c_exception | ( | std::ostream & | stream, |
| const terminate_detail & | e | ||
| ) |
| void strip_and_print_trace | ( | std::ostream & | stream, |
| cpptrace::stacktrace & | trace | ||
| ) |
|
inline |
| void terminate_ub_access_deleted | ( | std::string | func, |
| Args &&... | args | ||
| ) |
| void terminate_ub_access_nullptr | ( | std::string | func, |
| Args &&... | args | ||
| ) |
| void terminate_ub_invalid_iter | ( | std::string | func, |
| Args &&... | args | ||
| ) |
| void terminate_ub_iter_after_end | ( | std::string | func, |
| Args &&... | args | ||
| ) |
| void terminate_ub_iter_before_begin | ( | std::string | func, |
| Args &&... | args | ||
| ) |
| void terminate_ub_out_of_range | ( | std::string | func, |
| Args &&... | args | ||
| ) |
| void terminate_ub_wrong_iter | ( | std::string | func, |
| Args &&... | args | ||
| ) |
|
noexcept |
| bool throw_on_terminate |
通常は terminate(), undefined_behavior() で std::terminate()を呼んで強制終了するが、 これがtrueの場合代わりにthrowするようになる (主にテスト用)
投げた例外がdll境界を越えるとMacOSでめんどくさいことになるので、 例外はinline関数の中で投げる