Created
November 18, 2014 19:26
-
-
Save d1ff/2d3b3119b36676fbc855 to your computer and use it in GitHub Desktop.
boost type erasure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/type_erasure/any.hpp> | |
#include <boost/type_erasure/member.hpp> | |
#include <boost/mpl/vector.hpp> | |
BOOST_TYPE_ERASURE_MEMBER((has_init), init, 0) | |
BOOST_TYPE_ERASURE_MEMBER((has_loadIntoTexture), loadIntoTexture, 1) | |
using _self = boost::type_erasure::_self; | |
using initiable_concept = has_init<void(), _self>; | |
using loader_concept = has_loadIntoTexture<void(shared_ptr<AVFrame>), _self>; | |
using frame_loader_requirement = boost::mpl::vector< | |
initiable_concept, | |
loader_concept | |
>; | |
using any_frame_loader = boost::type_erasure::any<frame_loader_requirement, const _self&>; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment