BobSteagall / wg21

Various documents and code related to proposals for WG21
University of Illinois/NCSA Open Source License
65 stars 11 forks source link

`constexpr` all the things #39

Open mpusz opened 4 years ago

mpusz commented 4 years ago

LA operators are not constexpr for statically known bounds (literal types). The following code fails to compile:

template<Unit U = si::metre>
using v_length = fs_vector<si::length<U>, 3>;

static_assert(v_length<>{ 1q_m, 2q_m, 3q_m } + v_length<>{ 3q_m, 2q_m, 1q_m } == v_length<>{ 4q_m, 4q_m, 4q_m });
BobSteagall commented 1 year ago

done for r7z