Skip to content

Instantly share code, notes, and snippets.

@ThePhD
Created May 21, 2014 22:27
Show Gist options
  • Select an option

  • Save ThePhD/d6abff160bcd13f453bc to your computer and use it in GitHub Desktop.

Select an option

Save ThePhD/d6abff160bcd13f453bc to your computer and use it in GitHub Desktop.
Lame initializer_list and its rules
SeparableKernelFilter( std::initializer_list<float> kx, std::initializer_list<float> ky )
: SeparableKernelFilter( std::move( kx ), std::move( ky ), dummy ) {
}
template <typename Tx, typename Ty>
SeparableKernelFilter ( Tx&& xkern, Ty&& ykern, dummy_t = dummy ) {
for ( auto& x : xkern ) {
xkernel.push_back( static_cast<float>( x ) );
}
for ( auto& y : ykern ) {
ykernel.push_back( static_cast<float>( y ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment