Commit 75d4768f authored by Dominik Charousset's avatar Dominik Charousset

tbind

parent 3abc4894
...@@ -255,3 +255,4 @@ cppa/util/arg_match_t.hpp ...@@ -255,3 +255,4 @@ cppa/util/arg_match_t.hpp
cppa/detail/types_array.hpp cppa/detail/types_array.hpp
cppa/util/is_builtin.hpp cppa/util/is_builtin.hpp
cppa/util/type_pair.hpp cppa/util/type_pair.hpp
cppa/util/tbind.hpp
/******************************************************************************\
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#ifndef TBIND_HPP
#define TBIND_HPP
#endif // TBIND_HPP
...@@ -34,26 +34,26 @@ typedef std::pair<int,int> foobar; ...@@ -34,26 +34,26 @@ typedef std::pair<int,int> foobar;
static detail::types_array<int,anything,float> arr1; static detail::types_array<int,anything,float> arr1;
static detail::types_array<int,anything,foobar> arr2; static detail::types_array<int,anything,foobar> arr2;
template<template <typename, typename> class Tpl, typename Arg1> //template<template <typename, typename> class Tpl, typename Arg1>
struct tbind //struct tbind
{ //{
template<typename Arg2> // template<typename Arg2>
struct type // struct type
{ // {
static constexpr bool value = Tpl<Arg1, Arg2>::value; // static constexpr bool value = Tpl<Arg1, Arg2>::value;
}; // };
}; //};
template<template<typename> class Predicate, class Value> //template<template<typename> class Predicate, class Value>
struct foobaz //struct foobaz
{ //{
static constexpr bool value = Predicate<Value>::value; // static constexpr bool value = Predicate<Value>::value;
}; //};
size_t test__pattern() size_t test__pattern()
{ {
cout << "foobaz: " << foobaz<tbind<std::is_same, void>::type, void>::value << endl; //cout << "foobaz: " << foobaz<tbind<std::is_same, void>::type, void>::value << endl;
announce<foobar>(&foobar::first, &foobar::second); announce<foobar>(&foobar::first, &foobar::second);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment