• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Different classes instantiated from templates SHARE static members!!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Different classes instantiated from templates SHARE static members!!!
      • From: Adin Hunter Baber <email@hidden>
References: 
 >Re: Different classes instantiated from templates SHARE static members!!! (From: David A Rowland <email@hidden>)

  • Prev by Date: Re: [ADMIN] Monthly Reminder: How to Ask for Help on xcode-users
  • Next by Date: Re: Find In Project hanging on precompiled headers
  • Previous by thread: Re: Different classes instantiated from templates SHARE static members!!!
  • Next by thread: Re: Different classes instantiated from templates SHARE static members!!!
  • Index(es):
    • Date
    • Thread