Re: multimap and abstract class
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.
--=_mimegpg-commodore.email-scan.com-4867-1250766749-0003
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Barry writes:
Hi,
I have an abstract class called "Event" and a number of classes which
inherit from it, including "NoteOn" and "NoteOff".
I am now attempting to create a multimap called EventList, as follows
-
#ifndef EVENT_LIST_H
#include <map>
#include "Event.h"
class EventList : public std::multimap<double,Event>
{
public:
EventList(void);
virtual ~EventList(void);
};
#endif
#ifndef EVENT_H
class Event
{
public:
Event(void);
virtual void dummy() = 0;
virtual ~Event(void);
};
#endif
but this isn't allowed according to my compiler because 'Event' :
cannot instantiate abstract class.
I don't understand why I get this fail since I haven't even created a
EventList object yet.
Because the compiler evaluates the template definition, and finds out that
some of the template functions end up instantiating an abstract class,
which, of course, is an error.
--=_mimegpg-commodore.email-scan.com-4867-1250766749-0003
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEABECAAYFAkqNL50ACgkQx9p3GYHlUOK4QgCffYteebll8zZwfzaF6GbRVR0n
gcAAn2P8p9p+Id8lAh8ynlRW0OhKoU2W
=m+SG
-----END PGP SIGNATURE-----
--=_mimegpg-commodore.email-scan.com-4867-1250766749-0003--