-
-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Description
This is an incorrect function declaration:
class SoundData
{
public:
virtual bool init(const std::string& filename);
virtual bool init(const std::vector<uint8_t>& newData);
};
class SoundDataWave: public SoundData
{
public:
virtual bool init(const std::vector<uint8_t>& newData) override;
};
Because some compilers accept std::string for std::vector<uint8_t>. As a result, "virtual bool init (const std::string& filename);" not visible in the classes of the heirs. I suggest changing the name of the function "virtual bool init(const std::vector<uint8_t>& newData);" on "virtual bool initData(const std::vector <uint8_t>& newData);".
For example:
string path = "24-bit.wav";
// compile error:
SoundDataWave* pSoundDataWave = new SoundDataWave();
pSoundDataWave->init( path );
// compile ok:
SoundData* pSoundDataWave = new SoundDataWave();
pSoundDataWave->init( path );
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels