• 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: The bug where terminal and xcode ran "different"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The bug where terminal and xcode ran "different"


  • Subject: Re: The bug where terminal and xcode ran "different"
  • From: Marshall Clow <email@hidden>
  • Date: Sun, 11 Feb 2007 10:45:28 -0800

At 5:41 PM +0000 2/11/07, Theodore H. Smith wrote:
For the most part I'll be using stl classes. But what about for when you want to write the highest performance stuff? For example, can I assume that a vector stores it's data linearly in RAM? if so, I could use the vector to allocate the memory, and then just access it with a pointer. The best of both I'd say! Either that or make a class which does exactly the same thing.

Yes. One of the design criteria for vector is that it is able to interoperate with C code that expects arrays. "&*v.begin ()" (or alternately, "&v[0]") will give you a pointer to the first element in the vector. If your vector-unaware code writes past the end of the vector, you will get undefined behavior, but that's pretty much the same as with an array, isn't it. (Note: it's easy to mistake "capacity" and "size" in a vector).


One problem I have with stl, is that it's not really "lowest common denominator". The nice thing about simple libraries is that they tend to be available everywhere.

Now that I think about it, I think that idea might be a bit silly. Maybe an idea to use STL even within high performance code? I suppose STL should be available everywhere Iw ant to go these days right?

The STL is not available everywhere - lots of people (especially doing embedded work) are still using frighteningly old tool chains - gcc 2.9.5 or ADS 1.2 are considered "up to date", and those compilers generally have trouble with non-trivial templates.


However, C++ (including the STL) was adopted as an ANSI standard many years ago (1998, if I recall correctly); so compiler vendors have had quite a bit of time to update their products, and my opinion is that any compiler that doesn't support STL today counts as "no longer being developed".
--
-- Marshall


Marshall Clow     Idio Software   <mailto:email@hidden>

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.
_______________________________________________
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: The bug where terminal and xcode ran "different"
      • From: John Daniel <email@hidden>
References: 
 >Re: The bug where terminal and xcode ran "different" (From: Rob Probin <email@hidden>)
 >Re: The bug where terminal and xcode ran "different" (From: John Daniel <email@hidden>)
 >Re: The bug where terminal and xcode ran "different" (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: The bug where terminal and xcode ran "different"
  • Next by Date: Re: The bug where terminal and xcode ran "different"
  • Previous by thread: Re: The bug where terminal and xcode ran "different"
  • Next by thread: Re: The bug where terminal and xcode ran "different"
  • Index(es):
    • Date
    • Thread