It's a bit hard to know where to start here. It's not obvious from your code what you are trying to achieve.

In essence, you do have a circular reference as Base has functions that use a types A and B which are derived from the Base. I don't see how the complier could be asked to resolve this.

You are using a curious mix of tempting and inheritance, but depending one what you are trying to achieve, you may only need one or the other.

If you want classes other than A to recognise the value "v", then you should define a "v" property either in the Base class, a class derived from it or in an interface. This will allow you to use the correct overloading (or "static if" in templating) to catch the scenario of it being passed into the Foo function.

As I say. This is not a great real world example so it's hard to answer without a better explanation of what you are trying to do. It is not, however a bug in the compiler.

Just another note. "public" is redundant for a class.

Reply via email to