V
V
Vadim Mamonov2019-04-07 10:19:10
linux
Vadim Mamonov, 2019-04-07 10:19:10

How to compile c++ template functions on linux?

There is a function roughly like this:

templage <typename TGrid>
void myFunc1(const TGrid& grid) {
   cout << grid.Width << " " << grid.Height << endl;
}

In the windows view, everything works fine.
And on linux, I can’t even compile it, the compiler writes that it doesn’t see grid: Width and Height ..
I compile something like this mpicc -o --std-11 ***
Maybe there is something similar to that in C # ? Where can you specify that a generic type has such an interface, base class, etc??

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question