Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
オーバーロードに優先順位をつけるためのライブラリ。SFINAE のおともに。 C++ Overload Priority Library
// Copyright (C) 2011 RiSK (sscrisk)
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
#if defined(_MSC_VER) && _MSC_VER >= 1020
#pragma once
// overload_priority_hpp
namespace sscrisk{ namespace overload_priority{ namespace detail{
template<unsigned Priority>
struct overload_priority
: overload_priority<Priority - 1>
struct overload_priority<0>
typedef detail::overload_priority<6> const * highest;
typedef detail::overload_priority<5> const * higher;
typedef detail::overload_priority<4> const * high;
typedef detail::overload_priority<3> const * normal;
typedef detail::overload_priority<2> const * low;
typedef detail::overload_priority<1> const * lower;
typedef detail::overload_priority<0> const * lowest;
// ... is the lowest.
overload_priority::highest const use_overload_priority = nullptr;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment