Randall R Schulz wrote:
If you're interested in these things, I recommend you join us over on the Advanced-Java list run which is run from Discuss.Develop.com. It's a pretty low-volume list and is meant (as its name suggests) specifically to address advanced Java programming and design topics.
Thanks. Davi de Castro Reis wrote:
Yes. Boost has the concept_check stuff, but AFAIK, there is no runtime overhead at all. Also, you can guarantee the interface mixing templates and inheritance.
template <class T : public myInterfaceClassName> class ...
Pretty simple uh? But you rarely see people using it, because generic programming and traditional object programming seems to be some sort of competitors.
I couldn't find any reference to this in the draft standard or in
Stroustrup and I couldn't get an example like this to compile in g++
3.4.2 or 3.4.4 (though I know 3.4.2 won't accept some legal stuff like
class : public class A { ... } object;)
OTOH, when I tried an example, I found that
template<typename T>
class X {
...
private:
void do_nothing() const {
const T* const t = 0;
static_cast