5 Topics

Member Avatar for
Member Avatar for jkhippie

#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* …

Member Avatar for jkhippie
0
2K
Member Avatar for Elixir42

Dear Kind-Coders, I am trying to learn to use boost::shared_ptr to manage the lifetime of a DLL, but I am having a type conversion problem whilst setting it up. Please see the following code: #include <boost/make_shared.hpp> int main() { { class CMyClass { public: CMyClass() {} ~CMyClass() {} int MyInt; …

Member Avatar for Elixir42
0
2K
Member Avatar for sciwizeh

Hello all, I have not tested the code I'm posting here to see if it compiles, but I have an issue in a large codebase and I believe that this should be the simplest program to demonstrate the issue; class base { public: shared_ptr<base> clone()=0; }; typedef shared_ptr<base> baseptr; class …

Member Avatar for sciwizeh
0
20K
Member Avatar for badboy11

I need helping trying to retrieve data held in a [CODE]std::list<boost::shared_ptr<boost::any>>[/CODE] I am working on a Singleton Controller class with a private [B]std::list[/B]. Client class(es) will be able to [B]Add/Remove/Edit[/B] concrete class objects to be used by the program through this Controller class. The reason for using [B]boost::shared_ptr[/B] is because …

Member Avatar for mrnutty
0
383
Member Avatar for NordCoder

Hi Daniweb, I've been programming a base class resource manager for a game I'm working on, and so read up on boost's shared_ptr and weak_ptr. I'm done with it and it works and I would really appreciate some feedback on my choice of implementation and design. Am I using the …

0
163

The End.