mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Replace SFINAE with concepts (#5361)
Concepts are cleaner to use and result in much better error messages for incorrect template use.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#include <wpi/StringMap.h>
|
||||
#include <wpi/concepts.h>
|
||||
|
||||
#include "frc/smartdashboard/SendableChooserBase.h"
|
||||
|
||||
@@ -27,12 +28,9 @@ namespace frc {
|
||||
* @see SmartDashboard
|
||||
*/
|
||||
template <class T>
|
||||
requires std::copy_constructible<T> && std::default_initializable<T>
|
||||
class SendableChooser : public SendableChooserBase {
|
||||
wpi::StringMap<T> m_choices;
|
||||
static_assert(std::is_copy_constructible_v<T>,
|
||||
"T must be copy-constructible!");
|
||||
static_assert(std::is_default_constructible_v<T>,
|
||||
"T must be default-constructible!");
|
||||
|
||||
template <class U>
|
||||
static U _unwrap_smart_ptr(const U& value);
|
||||
|
||||
Reference in New Issue
Block a user