pedrohas2000 / pingus

Automatically exported from code.google.com/p/pingus
GNU General Public License v3.0
0 stars 0 forks source link

Remove constructors for unique_ptr #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Under Debian testing, with GCC 4.6.1, revision 
a6815c61cbeca2ec5e35c3f006033e538982612a breaks.

Under that revision, the build fails with:
src/editor/object_selector.cpp: In constructor 
‘Editor::ObjectSelector::ObjectSelector(Editor::EditorScreen*, const 
Rect&)’:
src/editor/object_selector.cpp:512:12: error: call of overloaded 
‘unique_ptr(int)’ is ambiguous

Calling the constructor of these unique_ptrs and passing 0 seems entirely 
unnecessary. Attached is a patch that simply removes the constructors. It also 
removes callback because it looks like it is entirely unused. This makes it 
compile fine on my machine, and looks safe to me.

Original issue reported on code.google.com by mikehenn...@eclipse.net on 17 Sep 2011 at 2:32

Attachments:

GoogleCodeExporter commented 9 years ago
The constructors are needed to make the code -Weffc++ clean, the (0) is however 
indeed wrong, I replaced it with the default constructor ().

Original comment by grum...@gmail.com on 17 Sep 2011 at 10:28

GoogleCodeExporter commented 9 years ago
Yes, that fixes it, thanks.

Original comment by mikehenn...@eclipse.net on 17 Sep 2011 at 2:45