Quantcast
Channel: programmingtipoftheday
Viewing all articles
Browse latest Browse all 10

Exporting the Std

$
0
0

So here is a piece of C++ advice.

Don’t export classes which are derived from std.

Your DLL will actually export the base class as well, and you will get crazy linker errors saying you have defined vector::operator[] twice.

What you need to do is write your subclass all in the header file, or don’t use std as base class, just keep it as a member



Viewing all articles
Browse latest Browse all 10

Trending Articles