Skip to content

Commit d0ce4f9

Browse files
committed
Switch to initializer_list for defined evaluation order
Fixes #4
1 parent 26cc577 commit d0ce4f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/jni/type_signature.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <jni/object.hpp>
55
#include <jni/array.hpp>
66

7+
#include <initializer_list>
78
#include <string>
89

910
namespace jni
@@ -44,12 +45,12 @@ namespace jni
4445
struct TypeSignature< R (Args...) >
4546
{
4647
private:
47-
template < class... T > void DoNothingWith( T&&... ) const {}
48+
template < class T > void DoNothingWith(const std::initializer_list<T>&) const {}
4849

4950
std::string Compute() const
5051
{
5152
static std::string result("(");
52-
DoNothingWith( ( result += TypeSignature<Args>()() )... );
53+
DoNothingWith<int>( { ( result += TypeSignature<Args>()(), 0 )... } );
5354
result += ")";
5455
result += TypeSignature<R>()();
5556
return result;

0 commit comments

Comments
 (0)