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:
Tyler Veness
2023-06-07 09:50:09 -07:00
committed by GitHub
parent d57d1a4598
commit 91cbcea841
42 changed files with 397 additions and 361 deletions

View File

@@ -5,9 +5,10 @@
#pragma once
#include <memory>
#include <type_traits>
#include <utility>
#include <wpi/concepts.h>
#include "frc2/command/Command.h"
#include "frc2/command/CommandPtr.h"
@@ -21,8 +22,7 @@ namespace frc2 {
*
* This class is provided by the NewCommands VendorDep
*/
template <typename Base, typename CRTP,
typename = std::enable_if_t<std::is_base_of_v<Command, Base>>>
template <std::derived_from<Command> Base, typename CRTP>
class CommandHelper : public Base {
using Base::Base;