diff --git a/src/utils.hh b/src/utils.hh index ee2591c0..68acc296 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -8,34 +8,6 @@ namespace Kakoune { -template -std::unique_ptr make_unique(Args&&... args) -{ - return std::unique_ptr(new T(std::forward(args)...)); -} - -template -struct IndexSequence -{ - using Next = IndexSequence; -}; - -template -struct MakeIndexSequence -{ - using Type = typename MakeIndexSequence::Type::Next; -}; - -template<> -struct MakeIndexSequence<0> -{ - using Type = IndexSequence<>; -}; - -template -constexpr typename MakeIndexSequence::Type -make_index_sequence() { return typename MakeIndexSequence::Type{}; } - // *** Singleton *** // // Singleton helper class, every singleton type T should inherit @@ -109,6 +81,12 @@ OnScopeEnd on_scope_end(T t) // *** Misc helper functions *** +template +std::unique_ptr make_unique(Args&&... args) +{ + return std::unique_ptr(new T(std::forward(args)...)); +} + template bool operator== (const std::unique_ptr& lhs, T* rhs) {