Skip to content

Commit

Permalink
[ntcore] NetworkTable::GetStruct: Add I template param
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Jan 9, 2024
1 parent f1836e1 commit b9bd7fc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ntcore/src/main/native/include/networktables/NetworkTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,10 @@ class NetworkTable final {
* @param name topic name
* @return Topic
*/
template <wpi::StructSerializable T>
StructTopic<T> GetStructTopic(std::string_view name) const {
return StructTopic<T>{GetTopic(name)};
template <typename T, typename... I>
requires wpi::StructSerializable<T, I...>
StructTopic<T, I...> GetStructTopic(std::string_view name) const {
return StructTopic<T, I...>{GetTopic(name)};
}

/**
Expand All @@ -259,9 +260,10 @@ class NetworkTable final {
* @param name topic name
* @return Topic
*/
template <wpi::StructSerializable T>
StructArrayTopic<T> GetStructArrayTopic(std::string_view name) const {
return StructArrayTopic<T>{GetTopic(name)};
template <typename T, typename... I>
requires wpi::StructSerializable<T, I...>
StructArrayTopic<T, I...> GetStructArrayTopic(std::string_view name) const {
return StructArrayTopic<T, I...>{GetTopic(name)};
}

/**
Expand Down

0 comments on commit b9bd7fc

Please sign in to comment.