Skip to main content
Code Review

Return to Answer

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

where Range<N> contains sequence 0,...N-1 and is defined here here. Now you can use it like this:

where Range<N> contains sequence 0,...N-1 and is defined here. Now you can use it like this:

where Range<N> contains sequence 0,...N-1 and is defined here. Now you can use it like this:

added 18 characters in body
Source Link
iavr
  • 2.3k
  • 1
  • 15
  • 25

It turns out pack is quite tricky to make non-recursiveandconstexpr, but as promised, here is a non-recursive, constexpr version of unpack (complete, live example):

It turns out pack is quite tricky to make non-recursive, but as promised, here is a non-recursive, constexpr version of unpack (complete, live example):

It turns out pack is quite tricky to make non-recursiveandconstexpr, but as promised, here is a non-recursive, constexpr version of unpack (complete, live example):

deleted 2 characters in body
Source Link
iavr
  • 2.3k
  • 1
  • 15
  • 25
int val = pack<int>(1, 0, 1);
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
std::cout << unpack(val) << std::endl;
// 0 0 0 0 0 1 0 1
std::cout << unpack<8>(val) << std::endl;
int val = pack<int>(1, 0, 1);
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
std::cout << unpack(val) << std::endl;
// 0 0 0 0 0 1 0 1
std::cout << unpack<8>(val) << std::endl;
int val = pack<int>(1, 0, 1);
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
std::cout << unpack(val) << std::endl;
// 0 0 0 0 0 1 0 1
std::cout << unpack<8>(val) << std::endl;
added 1480 characters in body
Source Link
iavr
  • 2.3k
  • 1
  • 15
  • 25
Loading
added 81 characters in body
Source Link
iavr
  • 2.3k
  • 1
  • 15
  • 25
Loading
Source Link
iavr
  • 2.3k
  • 1
  • 15
  • 25
Loading
lang-cpp

AltStyle によって変換されたページ (->オリジナル) /