-
Notifications
You must be signed in to change notification settings - Fork 1
/
contract
31 lines (25 loc) · 1.17 KB
/
contract
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// <contract> -*- C++ -*-
/** @file lib/Headers/contract
* This is a Standard C++ Library header.
*/
#ifndef _LIBCXX_CONTRACT
#define _LIBCXX_CONTRACT 1
#if __cplusplus < 201402L
# error "This file requires compiler and library support for the ISO C++ 2014 standard. This support must be enabled with the -std=c++14 compiler option."
#else
# if __cplusplus >= 201703L
# include <string_view>
# else
# include <experimental/string_view>
namespace std { using string_view = experimental::string_view; }
# endif /* __cplusplus >= 201703L */
namespace std {
using contract_violation = __builtin_contract_violation_t;
}
int __builtin_contract_violation_t::line_number() const noexcept { return __line; }
auto __builtin_contract_violation_t::file_name() const noexcept { return std::string_view{__file}; }
auto __builtin_contract_violation_t::function_name() const noexcept { return std::string_view{__func}; }
auto __builtin_contract_violation_t::comment() const noexcept { return std::string_view{__comment}; }
auto __builtin_contract_violation_t::assertion_level() const noexcept { return std::string_view{__level}; }
#endif /* __cplusplus < 201402L */
#endif /* _LIBCXX_CONTRACT */