Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
maps and constructors
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Victor Bazarov, post: 3404914"] There is no "bottom one" to speak of. What does the pointer point to? Without knowing that, it's impossible to tell you the difference in memory usage, performance, or anything else. Same story. You don't explain where the pointer comes from, how can we tell the difference? You should offer what the users want. Ask the users. Since you should synchronize the 'maps' it would be preferred to add both 'A' and 'B' at the same time. Whether the users are going to want to create a 'C' object from a pre-defined 'std::map', I am not sure. Isn't the fact that you store those in a map a simple implementation detail? It shouldn't dictate the user interface to your class, you know. That seems preferable. The users might also have arrays of 'double', 'A', and 'B', from which they might want you to create your 'C' object. Consider offering C::C(size_t N, double* keys, const A* v1, const B* v2); and tell them to make sure those arrays should better have at least N elements. Then create your map in a loop, for example. V [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
maps and constructors
Top