Skip to content

Commit 1bfc644

Browse files
committed
Export specialized template constructors
1 parent a07309e commit 1bfc644

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

include/graphqlservice/GraphQLResponse.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,8 @@ struct [[nodiscard]] IdType
6868
// Implicit ByteData constructors
6969
GRAPHQLRESPONSE_EXPORT IdType(size_t count, typename ByteData::value_type value = 0);
7070
GRAPHQLRESPONSE_EXPORT IdType(std::initializer_list<typename ByteData::value_type> values);
71-
7271
template <typename InputIt>
73-
IdType(InputIt begin, InputIt end)
74-
: _data { ByteData { begin, end } }
75-
{
76-
}
72+
IdType(InputIt begin, InputIt end);
7773

7874
// Assignment
7975
GRAPHQLRESPONSE_EXPORT IdType& operator=(IdType&& rhs) noexcept;
@@ -147,6 +143,12 @@ struct [[nodiscard]] IdType
147143
#ifdef GRAPHQL_DLLEXPORTS
148144
// Export all of the specialized template methods
149145
template <>
146+
GRAPHQLRESPONSE_EXPORT IdType::IdType(
147+
typename ByteData::const_iterator begin, typename ByteData::const_iterator end);
148+
template <>
149+
GRAPHQLRESPONSE_EXPORT IdType::IdType(
150+
typename ByteData::const_pointer begin, typename ByteData::const_pointer end);
151+
template <>
150152
GRAPHQLRESPONSE_EXPORT const IdType::ByteData& IdType::get<IdType::ByteData>() const;
151153
template <>
152154
GRAPHQLRESPONSE_EXPORT const IdType::OpaqueString& IdType::get<IdType::OpaqueString>() const;

src/GraphQLResponse.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ IdType::IdType(std::initializer_list<typename ByteData::value_type> values)
4141
{
4242
}
4343

44+
template <>
45+
IdType::IdType(typename ByteData::const_iterator begin, typename ByteData::const_iterator end)
46+
: _data { ByteData { begin, end } }
47+
{
48+
}
49+
50+
template <>
51+
IdType::IdType(typename ByteData::const_pointer begin, typename ByteData::const_pointer end)
52+
: _data { ByteData { begin, end } }
53+
{
54+
}
55+
4456
IdType& IdType::operator=(IdType&& rhs) noexcept
4557
{
4658
if (&rhs != this)

0 commit comments

Comments
 (0)