pdns icon indicating copy to clipboard operation
pdns copied to clipboard

auth, dnsdist, rec: Look at removing the number of elements from `std::array` declarations whenver possible

Open rgacogne opened this issue 3 years ago • 2 comments

  • Program: dnsdist
  • Issue type: Feature request

Short description

The compiler is usually able to derive the number of elements from the initializer.

rgacogne avatar Nov 28 '22 10:11 rgacogne

It turns out that it only works for std::arrays of ints (not passing the type and size), and you cannot pass only the type. C++20 has std::to_array but we are still at C++17 for now.

rgacogne avatar Nov 28 '22 11:11 rgacogne

Actually the type can be properly deducted in C++17, but one needs to be careful to check that the desirable type has been deduced.

rgacogne avatar Nov 28 '22 11:11 rgacogne