Skip to content

Commit

Permalink
remove std::forward
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Oct 15, 2024
1 parent 9af7d6b commit 000074e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/xtd.core/include/xtd/new_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/// @copyright Copyright (c) 2024 Gammasoft. All rights reserved.
#pragma once
#include "ptr.h"
#include <utility>

/// @brief The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
namespace xtd {
Expand All @@ -21,8 +20,8 @@ namespace xtd {
/// @endcode
/// @remarks The xtd::new_ptr is equivalent to [std::make_shared](https://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared).
template<typename type_t, typename ...args_t>
ptr<type_t> new_ptr(args_t&& ... args) {return ptr<type_t> {new type_t(std::forward<args_t>(args)...)};}
ptr<type_t> new_ptr(args_t&& ... args) {return ptr<type_t> {new type_t(args...)};}

/// @cond
template<typename type_t>
ptr<type_t> new_ptr(const type_t& arg) {return ptr<type_t> {new type_t(arg)};}
Expand Down
5 changes: 2 additions & 3 deletions src/xtd.core/include/xtd/new_uptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/// @copyright Copyright (c) 2024 Gammasoft. All rights reserved.
#pragma once
#include "uptr.h"
#include <utility>

/// @brief The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
namespace xtd {
Expand All @@ -21,8 +20,8 @@ namespace xtd {
/// @endcode
/// @remarks The xtd::new_uptr is equivalent to [std::make_unique](https://en.cppreference.com/w/cpp/memory/xtd::uptr/make_unique).
template<typename type_t, typename ...args_t>
uptr<type_t> new_uptr(args_t&& ... args) {return uptr<type_t> {new type_t(std::forward<args_t>(args)...)};}
uptr<type_t> new_uptr(args_t&& ... args) {return uptr<type_t> {new type_t(args...)};}

/// @cond
template<typename type_t>
uptr<type_t> new_uptr(const type_t& arg) {return uptr<type_t> {new type_t(arg)};}
Expand Down

0 comments on commit 000074e

Please sign in to comment.