WebAssembly / wasm-c-api

Wasm C API prototype
Apache License 2.0
550 stars 77 forks source link

Unconditional move of forwarding reference #117

Closed TartanLlama closed 4 years ago

TartanLlama commented 4 years ago

In vec::make:

  template<class... Ts>
  static auto make(Ts&&... args) -> vec {
    T data[] = { std::move(args)... };
    return make(sizeof...(Ts), data);
  }

The std::move(args)... should be std::forward<Args>(args)..., otherwise it will move from non-const lvalue reference arguments.

rossberg commented 4 years ago

Closed by #120.