This file contains 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 <type_traits> | |
template <bool C, class T, class F> | |
struct eval_if_c; | |
template <class T, class F> | |
struct eval_if_c<true, T, F> | |
{ | |
typedef typename T::type type; | |
}; |
This file contains 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 <algorithm>//copy | |
#include <cassert>//assert | |
#include <iostream>//cout | |
#include <iterator>//iterator | |
#include <limits>//numeric | |
#include <memory>//shared_ptr | |
#include <numeric>//accumelate | |
#include <random>//mt19937, distribution | |
#include <sstream>//stringstream; | |
#include <type_traits>//is_arithmetic |
This file contains 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
//ファンクタを適用する式 | |
#ifndef NEK_MATH_EXPRESSION_HPP | |
#define NEK_MATH_EXPRESSION_HPP | |
#include <type_traits>//is_same, declval, ... | |
namespace nek | |
{ | |
namespace math | |
{ |
This file contains 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/mpl/int.hpp> | |
#include <boost/mpl/eval_if.hpp> | |
#include <boost/mpl/multiplies.hpp> | |
#include <boost/mpl/equal_to.hpp> | |
using namespace boost; | |
template <class I> | |
struct factorial | |
: mpl::eval_if | |
< |
This file contains 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 <type_traits> | |
#include <utility> | |
#include <iostream> | |
struct static_cast_ | |
{ | |
template <class To, class From> | |
static To cast(From&& val) | |
{ |
This file contains 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 <iostream> | |
#include <type_traits> | |
#include <utility> | |
template <class To, class From> | |
struct needs_to_static_cast | |
: public std::integral_constant<bool, | |
std::is_convertible<typename std::remove_reference<From>::type, To>::value> | |
{}; |
This file contains 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 <tuple> | |
#include <list> | |
#include <iostream> | |
using namespace std; | |
class hoge | |
{ | |
public: | |
template <class... T1, class... T2> | |
hoge(tuple<T1...> t1, tuple<T2...> t2) |
This file contains 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 <future> | |
#include <iostream> | |
#include <chrono> | |
#include <thread> | |
#include <string> | |
#include <algorithm> | |
#include <boost/multiprecision/cpp_int.hpp> | |
#include <boost/multiprecision/cpp_dec_float.hpp> | |
boost::multiprecision::cpp_int simple(boost::multiprecision::cpp_int& n, int& i) |
This file contains 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 <iostream> | |
#include <boost/serialization/serialization.hpp> | |
#include <boost/serialization/nvp.hpp> | |
class Hoge | |
{ | |
public: | |
Hoge(int d, double& r) : data_(d), ref_(r) {} | |
int data() const { return data_; } | |
double const& ref() const { return ref_; } |
OlderNewer