Re: Different classes instantiated from templates SHARE static members!!!
Re: Different classes instantiated from templates SHARE static members!!!
- Subject: Re: Different classes instantiated from templates SHARE static members!!!
- From: Scott Ribe <email@hidden>
- Date: Fri, 05 Jan 2007 21:09:30 -0700
- Thread-topic: Different classes instantiated from templates SHARE static members!!!
> After checking the Standard and Stroustrup, I find that it is quite possible
> to "bind" a static member to an object in that way. It's just poor practice,
> IMO.
The example was condensed to the minimum necessary to demonstrate the bug.
In fact I never directly reference the data member from outside the class
using either notation, the actual templates expand to something more like:
class base
{ public: virtual const char ** getStuff(); };
class derived1 : public base
{ public: virtual const char ** getStuff() { return foo; }
protected: static const char * foo[];};
class derived2 : public base
{ public: virtual const char ** getStuff() { return foo; }
protected: static const char * foo[];};
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden