Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/c++/13/experimental/contract
$ cat -n /usr/include/c++/13/experimental/contract 1 // Contracts support header for -*- C++ -*- 2 3 // Copyright (C) 2019-2023 Free Software Foundation, Inc. 4 // 5 // This file is part of GCC. 6 // 7 // GCC is free software; you can redistribute it and/or modify 8 // it under the terms of the GNU General Public License as published by 9 // the Free Software Foundation; either version 3, or (at your option) 10 // any later version. 11 // 12 // GCC is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 // 17 // Under Section 7 of GPL version 3, you are granted additional 18 // permissions described in the GCC Runtime Library Exception, version 19 // 3.1, as published by the Free Software Foundation. 20 21 // You should have received a copy of the GNU General Public License and 22 // a copy of the GCC Runtime Library Exception along with this program; 23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 24 //
. 25 26 /** @file contract 27 * This is a Standard C++ Library header. 28 */ 29 30 #ifndef _GLIBCXX_CONTRACT 31 #define _GLIBCXX_CONTRACT 1 32 33 #pragma GCC system_header 34 35 #if __cplusplus >= 201703L 36 37 #include
38 #include
39 40 namespace std _GLIBCXX_VISIBILITY(default) 41 { 42 _GLIBCXX_BEGIN_NAMESPACE_VERSION 43 44 namespace experimental 45 { 46 // From P1332 47 enum class contract_violation_continuation_mode { 48 never_continue, maybe_continue 49 }; 50 51 class contract_violation { 52 const char* _M_file; 53 const char* _M_function; 54 const char* _M_comment; 55 const char* _M_level; 56 const char* _M_role; 57 uint_least32_t _M_line; 58 signed char _M_continue; 59 public: 60 // From N4820 61 uint_least32_t line_number() const noexcept { return _M_line; } 62 string_view file_name() const noexcept { return _M_file; } 63 string_view function_name() const noexcept { return _M_function; } 64 string_view comment() const noexcept { return _M_comment; } 65 string_view assertion_level() const noexcept { return _M_level; } 66 // From P1332 67 string_view assertion_role() const noexcept { return _M_role; } 68 contract_violation_continuation_mode continuation_mode() const noexcept 69 { return static_cast
(_M_continue); } 70 }; 71 72 } // namespace experimental 73 74 _GLIBCXX_END_NAMESPACE_VERSION 75 } // namespace std 76 77 // To override the contract violation handler, define 78 //void ::handle_contract_violation (const std::experimental::contract_violation &); 79 80 #endif // C++17 81 #endif // _GLIBCXX_CONTRACT
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™