Shriramana said:
Hello. In my app I am having to return short arrays of doubles
frequently from utility functions, the max length being 2. I am
concerned whether using vector would involve excessive memory usage
and unneeded copying at function return.
It would have to be a container type compatible with vector in the
sense of providing [] access and compatible with the algorithms
applicable to containers and so std:
air is not feasible.
In C++11 I suppose I could use array, but that's not an option for me
because I don't want to require C++11 support on my users' compilers.
(It's open-source and people with old compilers should be able to
compile it.)
Should I just roll my own simple class or can I just re-use vector
confident that it won't use too much memory?
Thanks!
Never use "std"-anything if you can "roll your own". Now I say that like I
am being facetious, but I really do know what I am talking about (wow,
that's a lot of "I"s! I realy should learn how to speak your language, or at
least TYPE it!).
Seriously, did you go to "programming school" (for instance, Comp Sci @
USA.college?). Well, you do know how to code at least THAT (?) (!)?
I never did anything (publicly) significant with C++. Though I could have.
As I am not a "quick study", now that "I know" C++, I reevaluate and think
that it's probably not worthwhile to deploy anything (for me).
As much as I try (what is "to try"?) to be able to go out and find people,
in "not having a handle" on that, surely it is "a personal problem". (This
may be a question. Did you recognize that possibility?).
There are a few really good programmers in these groups, i.e., I assume
that. I can make them better and more accomplished. I'm not saying that they
are defficient or need or want to be better or more accomplished, mind you,
I am just saying that I can do that, because it is really simple, not
necessarily easy (for me).
I wonder "if there is anyone out there", maybe with whom I have "conflicted"
or conflicted in the past that actually I could work with to achieve a
synergystic good. What is good? What's good for the goose is good for the
gander?
I think that just maybe, where I would want there to be a question, to a lot
of people, there is no question, no need for a question, never considered
that there may be a question...
OK, "alrighty then", for those who "have heard it all", don't want that,
don't need that, prefer to "get away with it", etc., but what about those
who need help or want help and "can't have it"? And who is MAKING all these
people who need help?
What if a requirement of Comp Sci completion was that you would be equally
adept at humanities (how long can you ponder at an Ed Hopper print? (I know,
that was cliche. The thing is, I don't think it is an either/or thing, but I
am sure that most people pick one or the other (?). How would I know... I've
never even been to Montana.).