Skip to main content
Active reading [<https://en.wikipedia.org/wiki/C%2B%2B20>].
Source Link
Peter Mortensen
  • 31.2k
  • 22
  • 111
  • 134

It seems that the following works (starting with c++20C++20)

#include <array>

template<std::array arr1, std::array arr2>
constexpr auto bar() {  return std::make_pair(arr1.size(), arr2.size());  }

static_assert (bar<{3,1,4,1,5},{2,4}>() == std::make_pair(5,2));

int main() {}

It seems that the following works (starting with c++20)

#include <array>

template<std::array arr1, std::array arr2>
constexpr auto bar() {  return std::make_pair(arr1.size(), arr2.size());  }

static_assert (bar<{3,1,4,1,5},{2,4}>() == std::make_pair(5,2));

int main() {}

It seems that the following works (starting with C++20)

#include <array>

template<std::array arr1, std::array arr2>
constexpr auto bar() {  return std::make_pair(arr1.size(), arr2.size());  }

static_assert (bar<{3,1,4,1,5},{2,4}>() == std::make_pair(5,2));

int main() {}
added 22 characters in body
Source Link
abcdefg
  • 5.6k
  • 1
  • 17
  • 35

It seems that the following works (starting with c++20)

#include <array>

template<std::array arr1, std::array arr2>
constexpr auto bar() {  return std::make_pair(arr1.size(), arr2.size());  }

static_assert (bar<{3,1,4,1,5},{2,4}>() == std::make_pair(5,2));

int main() {}

It seems that the following works

#include <array>

template<std::array arr1, std::array arr2>
constexpr auto bar() {  return std::make_pair(arr1.size(), arr2.size());  }

static_assert (bar<{3,1,4,1,5},{2,4}>() == std::make_pair(5,2));

int main() {}

It seems that the following works (starting with c++20)

#include <array>

template<std::array arr1, std::array arr2>
constexpr auto bar() {  return std::make_pair(arr1.size(), arr2.size());  }

static_assert (bar<{3,1,4,1,5},{2,4}>() == std::make_pair(5,2));

int main() {}
Source Link
abcdefg
  • 5.6k
  • 1
  • 17
  • 35

It seems that the following works

#include <array>

template<std::array arr1, std::array arr2>
constexpr auto bar() {  return std::make_pair(arr1.size(), arr2.size());  }

static_assert (bar<{3,1,4,1,5},{2,4}>() == std::make_pair(5,2));

int main() {}