Forum Discussion
Altera_Forum
Honored Contributor
21 years agoC++ Templates
Hello experts BUG in NIOS2 C++ compiler Declaration below, is template Class which valid (we where check it at other compilers ) ///////// IT IS VALID CODE BUT COMPILER TR...
Altera_Forum
Honored Contributor
21 years agoI guess the reason you want the initializer version of your code to work is so you can declare line_width as const int32 instead of just int32.
Do either of the following work? FlatScreen(int w,int h,int bpp,size_t lw,T* ptr):Screen(w,h,bpp),mData(ptr),line_width(lw?lw:size_t(w)*sizeof(T)) FlatScreen(int w,int h,int bpp,size_t lw,T* ptr):Screen(w,h,bpp),mData(ptr),line_width(size_t(lw?lw:w*sizeof(T))) And yes, please show us the actual error message.