#include <memory>
#include <deque>
void MyFunc
{
std::deque< std::shared_ptr< Sprite* > > SpriteList;
func_to_fill_deque( SpriteList );
for( auto i = SpriteList.begin(), end = SpriteList.end(); i != end; i++ )
{
SpriteList[ i ]->spriteFunc(); // doesn't work
SpriteList.at( i )->spriteFunc(); // also doesn't work
}
}
void func_to_fill_deque( std::deque< std::shared_ptr< Sprite* > >& list )
{
ptr = new Sprite( filename );
list.push_back( std::make_shared< Sprite* >( ptr ) );
}
When I try SpriteList[ i ] I get a red squiggle under the first '[' with the msg "No operator matches these operands" Trying SpriteList.at( i ) gives a red squiggle under the '.' with the msg "No overloaded function matches the argument list" This is in VS2013 if it matters. Any help would be appreciated.