Skip to content

Commit

Permalink
Remove unusable std::unique_ptr case for SendableChooser
Browse files Browse the repository at this point in the history
  • Loading branch information
KangarooKoala committed Feb 10, 2024
1 parent 1db3936 commit f32f592
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ class SendableChooser : public SendableChooserBase {
template <class U>
static U _unwrap_smart_ptr(const U& value);

template <class U>
static U* _unwrap_smart_ptr(const std::unique_ptr<U>& value);

template <class U>
static std::weak_ptr<U> _unwrap_smart_ptr(const std::shared_ptr<U>& value);

Expand Down Expand Up @@ -71,8 +68,8 @@ class SendableChooser : public SendableChooserBase {
void SetDefaultOption(std::string_view name, T object);

/**
* Returns a copy of the selected option (a raw pointer U* if T =
* std::unique_ptr<U> or a std::weak_ptr<U> if T = std::shared_ptr<U>).
* Returns a copy of the selected option (a std::weak_ptr<U> if T =
* std::shared_ptr<U>).
*
* If there is none selected, it will return the default. If there is none
* selected and no default, then it will return a value-initialized instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ U SendableChooser<T>::_unwrap_smart_ptr(const U& value) {
return value;
}

template <class T>
requires std::copy_constructible<T> && std::default_initializable<T>
template <class U>
U* SendableChooser<T>::_unwrap_smart_ptr(const std::unique_ptr<U>& value) {
return value.get();
}

template <class T>
requires std::copy_constructible<T> && std::default_initializable<T>
template <class U>
Expand Down

0 comments on commit f32f592

Please sign in to comment.