adding interface example

fixing build errors

adding Boost to travis.yml

fixing travis.yml

fixing travis.yml

fixing travis.yml, fixing for libstdc++ bug

fixing travis.yml

fixing travis.yml

adding is_like_function

fixing interface example, doc gen

removing rogue tab characters

fixing build error

adding FunctionTypes section in documentation

removing empty note

fixing misspelling of inheritance
This commit is contained in:
badair
2016-05-02 23:05:01 -05:00
parent f9f99c87db
commit f5459061f0
63 changed files with 3122 additions and 1085 deletions

View File

@@ -0,0 +1,54 @@
/*<-
Copyright Barrett Adair 2016
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt)
->*/
#include <callable_traits/config.hpp>
#ifdef CALLABLE_TRAITS_DISABLE_CONSTEXPR_CHECKS
int main(){ return 0; }
#else
//[ make_function_example
#include <cassert>
#include "make_function.hpp"
using namespace example;
using namespace std::placeholders;
int add(int i, int j) {
return i + j;
}
struct adder {
int eval(int i, int j) const {
return i + j;
}
};
int main() {
// function pointer
auto f = make_function(&add);
assert(f(99, 1) == 100);
// function reference
f = make_function(add);
assert(f(99, 1) == 100);
// member function pointer (bound to object)
f = make_function(&adder::eval, adder{}, _1, _2);
assert(f(99, 1) == 100);
// lambda
f = make_function([](int i, int j) {
return i + j;
});
assert(f(99, 1) == 100);
}
//]
#endif