dim is always a template argument both in compile-time and runtime classes