[wpilibc] SendableChooser: Remove unusable std::unique_ptr case (#6357)

This commit is contained in:
Joseph Eng
2024-02-10 10:41:57 -08:00
committed by GitHub
parent e9c744c456
commit 163f7ee704
2 changed files with 2 additions and 12 deletions

View File

@@ -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);
@@ -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.

View File

@@ -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>