Skip to content

Commit

Permalink
Replace tl::index_sequence with C++14 std::index_sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Oct 12, 2023
1 parent 100db09 commit 30d3269
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 77 deletions.
4 changes: 0 additions & 4 deletions pkg/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ Files: src/3rdparty/gsl_finally.h
Copyright: 2015 Microsoft Corporation
License: Expat

Files: src/3rdparty/integer_sequence.hpp
Copyright: 2017 by Simon Brand
License: CC0

Files: src/3rdparty/physfs.hpp
Copyright: 2013 Kevin Howell and others
2018 Arthur Brainville (Ybalrid)
Expand Down
70 changes: 0 additions & 70 deletions src/3rdparty/integer_sequence.hpp

This file was deleted.

6 changes: 3 additions & 3 deletions src/quickjs_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ MSVC_PRAGMA(warning( pop ))
#pragma GCC diagnostic pop
#endif
#include "3rdparty/gsl_finally.h"
#include "3rdparty/integer_sequence.hpp"
#include <utility>

// Alternatives for C++ - can't use the JS_CFUNC_DEF / JS_CGETSET_DEF / etc defines
// #define JS_CFUNC_DEF(name, length, func1) { name, JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE, JS_DEF_CFUNC, 0, .u = { .func = { length, JS_CFUNC_generic, { .generic = func1 } } } }
Expand Down Expand Up @@ -2136,7 +2136,7 @@ static JSValue callFunction(JSContext *ctx, const std::string &function, std::ve

template<typename...T> struct UnboxTupleIndex;
template<size_t...I, typename...T>
struct UnboxTupleIndex<tl::index_sequence<I...>, T...>
struct UnboxTupleIndex<std::index_sequence<I...>, T...>
{
public:
typedef std::tuple<const wzapi::execution_context&, T...> tuple_type;
Expand Down Expand Up @@ -2174,7 +2174,7 @@ static JSValue callFunction(JSContext *ctx, const std::string &function, std::ve
tuple_ref_type value;
};

template<typename...T> using UnboxTuple = UnboxTupleIndex<tl::make_index_sequence<sizeof...(T)>, T...>;
template<typename...T> using UnboxTuple = UnboxTupleIndex<std::make_index_sequence<sizeof...(T)>, T...>;

MSVC_PRAGMA(warning( push )) // see matching "pop" below
MSVC_PRAGMA(warning( disable : 4189 )) // disable "warning C4189: 'idx': local variable is initialized but not referenced"
Expand Down

0 comments on commit 30d3269

Please sign in to comment.