This examples shows how to dispatch functor instances based on a polymorphic storage instance.
#include "latbuilder/Storage.h"
#include "latbuilder/SizeParam.h"
#include <iostream>
template <LatType LAT, Compress COMP>
{
std::cout << "storage name: " << storage.name() << std::endl;
std::cout << " size parameter: " << storage.sizeParam() << std::endl;
std::cout << " virtual size: " << storage.virtualSize() << std::endl;
std::cout << " actual size: " << storage.size() << std::endl;
}
int main()
{
test<LatType::ORDINARY, Compress::NONE>(n);
test<LatType::EMBEDDED, Compress::NONE>(n);
test<LatType::ORDINARY, Compress::SYMMETRIC>(n);
test<LatType::EMBEDDED, Compress::SYMMETRIC>(n);
return 0;
}