• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    C++
  • License
    Boost Software Li...
  • Created about 8 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of awful archetypes to ease the testing of generic C++ libraries

libawful Travis status

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, <awful.hpp>, which defines all the archetypes.

#include <awful.hpp>
#include <utility>

template <typename T, typename U>
struct naive_pair {
  T first;
  U second;

  naive_pair() = default;

  template <typename Other, typename = decltype(std::declval<Other>().first),
                            typename = decltype(std::declval<Other>().second)>
  naive_pair(Other&& other)
    : first(std::forward<Other>(other).first),
      second(std::forward<Other>(other).second)
  { }
};

int main() {
  naive_pair<awful::trapconstructible, int> 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.

More Repositories

1

dyno

Runtime polymorphism done right
C++
975
star
2

metabench

A simple framework for compile-time benchmarks
CMake
181
star
3

mpl11

Enjoy template metaprogramming
C++
113
star
4

reveal-sampler

A reveal.js plugin to fetch code samples from source files
JavaScript
26
star
5

chaos-pp

Clone of the Chaos CVS repository using git-cvsimport.
C
12
star
6

wg21

My proposals for the C++ standard
TeX
11
star
7

cppnow-2015-hana

Presentation on Hana for C++Now 2015
JavaScript
10
star
8

hawick_circuits

Implementation of an algorithm to find all the elementary circuits in a directed (multi)graph.
C++
10
star
9

d2

A library-based approach to deadlock detection using dynamic analysis.
C++
9
star
10

react

A C++11 framework for incremental computation.
C++
7
star
11

nstl

The non standard template library.
C
7
star
12

cppcon-2018-compile-time-programming

My slides on compile-time programming in C++20 for CppCon 2018
JavaScript
7
star
13

cisp

A C preprocessor library implementing object semantics.
C
6
star
14

duck

A template metaprogramming library for concept-based overloading in C++11.
C++
6
star
15

joy

A preprocessor metaprogramming library.
C
6
star
16

P1221-presentation

Presentation of https://wg21.link/P1221 on behalf of Jason Rice
CSS
5
star
17

cppcon-2015-hana

Presentation on Hana and metaprogramming for CppCon 2015
CSS
5
star
18

meetingcpp-2016

My presentation material for the closing keynote of Meeting C++ 2016
HTML
5
star
19

cppnow-2016-metaprogramming-for-the-brave

My "Metaprogramming for the brave" presentation for C++Now 2016
HTML
5
star
20

cppnow-2018-runtime-polymorphism

My presentation on runtime polymorphism at C++Now 2018
JavaScript
5
star
21

cppnow-2016-metaprogramming-for-dummies

My "Metaprogramming for dummies" presentation for C++Now 2016
CSS
5
star
22

hana-thesis

Bachelor's thesis on Hana and category theory. In french only.
JavaScript
4
star
23

accu-2017-metaprogramming-in-cpp14

My presentation on metaprogramming for ACCU 2017
HTML
4
star
24

cppnow-2017-fun-with-boost-hana

My "Fun with Boost.Hana" presentation for C++Now 2017
HTML
3
star
25

accu-2018-runtime-polymorphism

My presentation on runtime polymorphism at ACCU 2018
JavaScript
3
star
26

cppcon-2017-runtime-polymorphism

My presentation on runtime polymorphism at CppCon 2017
CSS
3
star
27

cppcon-2019-abi-from-the-ground-up

My talk on the C++ ABI for CppCon 2019
CSS
3
star
28

cppnow-2018-empty-objects

Lightning talk about template errors for C++Now 2018
CSS
2
star
29

mpl_extensions

Extensions to the Boost.MPL library.
C++
2
star
30

accu-2017-rust-traits-in-cpp

My lightning talk on dynamic polymorphism at ACCU 2017
CSS
2
star
31

accu-bay-area-meetup-03-2017

My presentation on metaprogramming for the March 2017 ACCU Bay Area C++ Meetup
HTML
2
star
32

cppnow-2014-mpl11

Presentation of the MPL11 at C++Now 2014
JavaScript
2
star
33

docker-cpp-test

Nothing to see here. I'm experimenting with Docker on Travis CI
2
star
34

cppnow-2013-d2

My presentation on deadlock detection for the C++Now 2013 conference.
CSS
1
star
35

dbg-d2

The dbg library with modifications for use by d2.
C++
1
star
36

macroize

A small utility to backslash escape long macro definitions in C and C++.
Python
1
star