471,059 Members | 1,459 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,059 software developers and data experts.

Map of Parent Type and calling child type copy constructor

Hi. I'm try to construct a map<int, Shapeso that I can keep a list of
Shapes. Here's a simplified version of my code so far:

Shape
{

};

--
Posted via a free Usenet account from http://www.teranews.com

Jul 12 '06 #1
4 1245
Brandt Dusthimer wrote:
Hi. I'm try to construct a map<int, Shapeso that I can keep a list of
Shapes. Here's a simplified version of my code so far:

Shape
{

};
Nothing wrong with it so far. Keep up the good work!

Cheers! --M

Jul 12 '06 #2

Brandt Dusthimer wrote:
Hi. I'm try to construct a map<int, Shapeso that I can keep a list of
Shapes. Here's a simplified version of my code so far:

Shape
{

};
They say true simplicity is genius!

Jul 12 '06 #3
mlimber wrote:
Brandt Dusthimer wrote:
Hi. I'm try to construct a map<int, Shapeso that I can keep a list of
Shapes. Here's a simplified version of my code so far:

Shape
{

};

Nothing wrong with it so far. Keep up the good work!

Really? Shouldn't it at least be "class Shape {};" ? Or "struct Shape
{};" ?

Best regards,

Tom

Jul 12 '06 #4
"Brandt Dusthimer" <du******@u.netwrote in message
news:pa****************************@u.net...
Hi. I'm try to construct a map<int, Shapeso that I can keep a list of
Shapes. Here's a simplified version of my code so far:

Shape
{

};
Well, I would say that was pretty simple. It won't even compile. Try this.

#include <map>

class Shape
{
};

int main()
{
std::map< int, Shape ShapeMap;
}
Jul 12 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Maheshkumar.R | last post: by
10 posts views Thread by Goran Djuranovic | last post: by
6 posts views Thread by reandeau | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.