Tweak utils.hh, remove unused index sequence

This commit is contained in:
Maxime Coste 2016-02-18 09:53:01 +00:00
parent 47df1374fe
commit fbb326173a

View File

@ -8,34 +8,6 @@
namespace Kakoune
{
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
template<size_t... I>
struct IndexSequence
{
using Next = IndexSequence<I..., sizeof...(I)>;
};
template<size_t N>
struct MakeIndexSequence
{
using Type = typename MakeIndexSequence<N-1>::Type::Next;
};
template<>
struct MakeIndexSequence<0>
{
using Type = IndexSequence<>;
};
template<size_t N>
constexpr typename MakeIndexSequence<N>::Type
make_index_sequence() { return typename MakeIndexSequence<N>::Type{}; }
// *** Singleton ***
//
// Singleton helper class, every singleton type T should inherit
@ -109,6 +81,12 @@ OnScopeEnd<T> on_scope_end(T t)
// *** Misc helper functions ***
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
template<typename T>
bool operator== (const std::unique_ptr<T>& lhs, T* rhs)
{