~karsten.klagges/openwns-allinone/trunk

« back to all changes in this revision

Viewing changes to framework/library/src/container/UntypedRegistry.hpp

  • Committer: Karsten Klagges
  • Date: 2017-12-17 10:22:57 UTC
  • Revision ID: karsten.klagges@voiceworks.com-20171217102257-5hrskgul9q2cekuf
Say good bye to C++98
Say hello to C++11

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        void
77
77
        insert(const KEY& key, ELEMENT element)
78
78
    {
79
 
        // to avoid memory leak in case of exception we use an auto_ptr
80
 
        std::auto_ptr<ChamaeleonBase>
 
79
        // to avoid memory leak in case of exception we use an unique_ptr
 
80
        std::unique_ptr<ChamaeleonBase>
81
81
            chamaeleonPtr(new Chamaeleon<ELEMENT>(element));
82
82
        instances_.insert(key, chamaeleonPtr.get());
83
 
        // release the auto_ptr, everything went fine, registry takes
 
83
        // release the unique_ptr, everything went fine, registry takes
84
84
        // control
85
85
        chamaeleonPtr.release();
86
86
    }
125
125
        update(const KeyType& key, ELEMENT element)
126
126
    {
127
127
        // to avoid memory leak in case of exception we use an auto_ptr
128
 
        std::auto_ptr<ChamaeleonBase>
 
128
        std::unique_ptr<ChamaeleonBase>
129
129
            chamaeleonPtr(new Chamaeleon<ELEMENT>(element));
130
130
        instances_.update(key, chamaeleonPtr.get());
131
131
        // release the auto_ptr, everything went fine, registry takes