https://github.com/sgorsten/any_function
any_function is a functional counterpart to std::any
https://github.com/sgorsten/any_function
Last synced: about 1 month ago
JSON representation
any_function is a functional counterpart to std::any
- Host: GitHub
- URL: https://github.com/sgorsten/any_function
- Owner: sgorsten
- License: unlicense
- Archived: true
- Created: 2016-05-08T20:23:48.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-09T05:34:57.000Z (about 9 years ago)
- Last Synced: 2024-11-14T21:38:07.060Z (7 months ago)
- Language: C++
- Size: 120 KB
- Stars: 14
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- AwesomeCppGameDev - any_function
README
# any_function.h
[](/any_function.h)
[](http://unlicense.org/)Platform | Build Status |
-------- | ------------ |
Visual Studio 2013 | [AppVeyor](http://ci.appveyor.com/): [](https://ci.appveyor.com/project/sgorsten/any-function) |
GCC 4.9 | [Travis CI](http://travis-ci.org): [](https://travis-ci.org/sgorsten/any_function) |[any_function.h](/any_function.h) is a [single header](http://github.com/nothings/stb/blob/master/docs/other_libs.md) [public domain](http://unlicense.org/) utility library for [C++11](http://en.cppreference.com/w/).
It is intended to serve as a functional counterpart to the [`std::any`](http://en.cppreference.com/w/cpp/utility/any), by providing a single, concrete class `any_function` which can receive almost any callable object, from function pointers to lambdas to instantiations of [`std::function`](http://en.cppreference.com/w/cpp/utility/functional/function).
This library is still under development and its API and implementation details are subject to change.
# TODO
- [X] Retain reference/const/volatile qualification in parameter and return type metadata
- [X] L-value reference parameters (should work, but needs testing)
- [X] R-value reference parameters
- [X] L-value reference return types
- [X] R-value reference return types
- [X] Const/volatile qualified parameters
- [X] Const/volatile qualified return type
- [X] Mutable lambdas / stateful function objects