Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ldionne/libawful
A collection of awful archetypes to ease the testing of generic C++ libraries
https://github.com/ldionne/libawful
archetype cpp cpp11 cpp14 generic-programming testing
Last synced: about 2 months ago
JSON representation
A collection of awful archetypes to ease the testing of generic C++ libraries
- Host: GitHub
- URL: https://github.com/ldionne/libawful
- Owner: ldionne
- License: bsl-1.0
- Created: 2016-09-18T23:49:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-04T15:28:26.000Z (over 5 years ago)
- Last Synced: 2024-10-26T12:46:24.197Z (about 2 months ago)
- Topics: archetype, cpp, cpp11, cpp14, generic-programming, testing
- Language: C++
- Size: 15.6 KB
- Stars: 109
- Watchers: 6
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# libawful ![Travis status][badge.Travis]
> A collection of awful archetypes for testing generic code
## Overview
When writing a generic library, one often needs to test generic components with
types having infrequent characteristics. This is to make sure that a generic
component is not assuming more about its inputs than it should. __libawful__
is a collection of types with unusual properties that can be used to check for
corner cases when implementing generic components. The project contains a single
header, ``, which defines all the archetypes.```c++
#include
#includetemplate
struct naive_pair {
T first;
U second;naive_pair() = default;
template ().first),
typename = decltype(std::declval().second)>
naive_pair(Other&& other)
: first(std::forward(other).first),
second(std::forward(other).second)
{ }
};int main() {
naive_pair pair;
auto copy = pair; // ERROR: naive_pair tries to copy-construct its first
// member from a non-const reference to `pair.first`.
}
```## Compiler requirements
This is a C++14 library, and no effort whatsoever will be made to accommodate
nonconforming compilers.[badge.Travis]: https://travis-ci.org/ldionne/libawful.svg?branch=master