Frogger3140

Because I can

Apr 20th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1.     namespace _tables {
  2.         template <uint64_t H>
  3.         class sines {
  4.         public:
  5.             constexpr static std::array<float, H> values{ 0.0 };
  6.             constexpr sines() {
  7.                 std::array<float, H> i;
  8.                 std::iota(i.begin(), i.end(), 0.0);
  9.                 std::transform(i.begin(), i.end(), values.begin(),
  10.                                [](const float& a){
  11.                                    return a / M_PI_2 / static_cast<float>(H);
  12.                 });
  13.             }
  14.         };
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment