Skip to content

Commit

Permalink
Add the new header to relevant files
Browse files Browse the repository at this point in the history
  • Loading branch information
Coolthulhu committed Jun 30, 2016
1 parent 81f0b9a commit 6446e5d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions CataclysmWin.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@
<Unit filename="src/coordinate_conversions.cpp" />
<Unit filename="src/coordinate_conversions.h" />
<Unit filename="src/coordinates.h" />
<Unit filename="src/copyable_unique_ptr.h" />
<Unit filename="src/craft_command.cpp" />
<Unit filename="src/craft_command.h" />
<Unit filename="src/crafting.cpp" />
Expand Down
1 change: 1 addition & 0 deletions astyled_whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ src/computer.h
src/construction.h
src/coordinate_conversions.h
src/coordinates.h
src/copyable_unique_ptr.h
src/craft_command.h
src/crafting_gui.h
src/creature_tracker.h
Expand Down
3 changes: 2 additions & 1 deletion msvc-full-features/Cataclysm.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
<ClInclude Include="..\src\construction.h" />
<ClInclude Include="..\src\coordinates.h" />
<ClInclude Include="..\src\coordinate_conversions.h" />
<ClInclude Include="..\src\copyable_unique_ptr.h" />
<ClInclude Include="..\src\crafting.h" />
<ClInclude Include="..\src\crafting_gui.h" />
<ClInclude Include="..\src\craft_command.h" />
Expand Down Expand Up @@ -551,4 +552,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
9 changes: 5 additions & 4 deletions src/copyable_unique_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
#include <memory>

template <typename T>
class copyable_unique_ptr : public std::unique_ptr<T> {
class copyable_unique_ptr : public std::unique_ptr<T>
{
public:
copyable_unique_ptr() = default;
copyable_unique_ptr( copyable_unique_ptr&& rhs ) = default;
copyable_unique_ptr( copyable_unique_ptr &&rhs ) = default;

copyable_unique_ptr( const copyable_unique_ptr<T>& rhs )
copyable_unique_ptr( const copyable_unique_ptr<T> &rhs )
: std::unique_ptr<T>( rhs ? new T( *rhs ) : nullptr ) {}

copyable_unique_ptr &operator=( const copyable_unique_ptr<T>& rhs ) {
copyable_unique_ptr &operator=( const copyable_unique_ptr<T> &rhs ) {
std::unique_ptr<T>::reset( rhs ? new T( *rhs ) : nullptr );
return *this;
}
Expand Down
1 change: 0 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ void DynamicDataLoader::finalize_loaded_data()
MonsterGenerator::generator().finalize_mtypes();
MonsterGroupManager::FinalizeMonsterGroups();
monfactions::finalize();
requirement_data::finalize();
finalize_recipes();
finialize_martial_arts();
finalize_constructions();
Expand Down

0 comments on commit 6446e5d

Please sign in to comment.