https://github.com/marzer/noexcept
Type traits for manipulating `noexcept` in C++17.
https://github.com/marzer/noexcept
cpp
Last synced: 9 months ago
JSON representation
Type traits for manipulating `noexcept` in C++17.
- Host: GitHub
- URL: https://github.com/marzer/noexcept
- Owner: marzer
- License: mit
- Created: 2023-06-17T12:04:10.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-22T14:37:46.000Z (about 3 years ago)
- Last Synced: 2025-01-28T11:18:21.490Z (over 1 year ago)
- Topics: cpp
- Language: C++
- Homepage:
- Size: 58.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# `mz::noexcept` [](./LICENSE) [][cpp_compilers] [][sponsor] [][gitter]
Traits for manipulating `noexcept` in C++'s type system.
Requires C++17.
## Synopsis
```cpp
namespace mz
{
// has member 'type' as T with the `noexcept` specifier added
//
// ::type will simply be T if T is not a function or
// (possibly cv-qualified) member function pointer type.
template
struct add_noexcept;
// type alias for directly unpacking add_noexcept
// (in the same vein as std::add_const / std::add_const_t, etc.)
template
using add_noexcept_t = typename add_noexcept::type;
// has member 'type' as T with the `noexcept` specifier removed
//
// ::type will simply be T if T is not a function or
// (possibly cv-qualified) member function pointer type.
template
struct remove_noexcept;
// type alias for directly unpacking remove_noexcept
// (in the same vein as std::remove_const / std::remove_const_t, etc.)
template
using remove_noexcept_t = typename remove_noexcept::type;
// has member 'value' indicating if T was a function
// or member function pointer type with the noexcept specifier present.
template
struct is_noexcept;
// variable template containing the value of is_noexcept
// (in the same vein as std::is_const / std::is_const_v, etc.)
template
inline constexpr bool is_noexcept_v = is_noexcept::value;
}
```
## Usage
The library is a single header so the easiest way to use it is to drop [noexcept.hpp] somewhere in your project.
Alternatively you can add `include` to your include paths then `#include `
There is also support for use as a `meson.build` subproject.
## License
MIT. See [LICENSE](LICENSE).
## Contributing
There are three ways you can contribute:
1. Reporting bug or making feature requests [here](https://github.com/marzer/noexcept/issues/new)
2. Opening a pull request (⚠️ _caveat - see below_)
3. Becoming a [sponsor] ❤️
## WG21 C++ Proposal
This project is an implementation of a C++ library proposal I'm in the process of
putting together, with the intent of having these traits become part of the standard's
``library. You can read the paper [here](https://marzer.github.io/noexcept/).
[noexcept.hpp]: include/mz/noexcept.hpp
[license]: ./LICENSE
[cpp_compilers]: https://en.cppreference.com/w/cpp/compiler_support
[gitter]: https://gitter.im/marzer/community
[sponsor]: https://github.com/sponsors/marzer