Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup redundant inline specifiers #262

Merged
merged 1 commit into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions include/graphqlservice/GraphQLClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ struct ModifiedVariable

// Peel off the none modifier. If it's included, it should always be last in the list.
template <TypeModifier Modifier = TypeModifier::None, TypeModifier... Other>
[[nodiscard]] static inline response::Value serialize(
[[nodiscard]] static response::Value serialize(
Type&& value) requires OnlyNoneModifiers<Modifier, Other...>
{
// Just call through to the non-template method without the modifiers.
Expand All @@ -155,7 +155,7 @@ struct ModifiedVariable

// Peel off nullable modifiers.
template <TypeModifier Modifier, TypeModifier... Other>
[[nodiscard]] static inline response::Value serialize(
[[nodiscard]] static response::Value serialize(
typename VariableTraits<Type, Modifier, Other...>::type&& nullableValue) requires
NullableModifier<Modifier>
{
Expand All @@ -172,7 +172,7 @@ struct ModifiedVariable

// Peel off list modifiers.
template <TypeModifier Modifier, TypeModifier... Other>
[[nodiscard]] static inline response::Value serialize(
[[nodiscard]] static response::Value serialize(
typename VariableTraits<Type, Modifier, Other...>::type&& listValue) requires
ListModifier<Modifier>
{
Expand All @@ -189,7 +189,7 @@ struct ModifiedVariable

// Peel off the none modifier. If it's included, it should always be last in the list.
template <TypeModifier Modifier = TypeModifier::None, TypeModifier... Other>
[[nodiscard]] static inline Type duplicate(
[[nodiscard]] static Type duplicate(
const Type& value) requires OnlyNoneModifiers<Modifier, Other...>
{
// Just copy the value.
Expand All @@ -198,7 +198,7 @@ struct ModifiedVariable

// Peel off nullable modifiers.
template <TypeModifier Modifier, TypeModifier... Other>
[[nodiscard]] static inline typename VariableTraits<Type, Modifier, Other...>::type duplicate(
[[nodiscard]] static typename VariableTraits<Type, Modifier, Other...>::type duplicate(
const typename VariableTraits<Type, Modifier, Other...>::type& nullableValue) requires
NullableModifier<Modifier>
{
Expand All @@ -222,7 +222,7 @@ struct ModifiedVariable

// Peel off list modifiers.
template <TypeModifier Modifier, TypeModifier... Other>
[[nodiscard]] static inline typename VariableTraits<Type, Modifier, Other...>::type duplicate(
[[nodiscard]] static typename VariableTraits<Type, Modifier, Other...>::type duplicate(
const typename VariableTraits<Type, Modifier, Other...>::type& listValue) requires
ListModifier<Modifier>
{
Expand Down Expand Up @@ -296,15 +296,15 @@ struct ModifiedResponse

// Peel off the none modifier. If it's included, it should always be last in the list.
template <TypeModifier Modifier = TypeModifier::None, TypeModifier... Other>
[[nodiscard]] static inline Type parse(
[[nodiscard]] static Type parse(
response::Value&& response) requires OnlyNoneModifiers<Modifier, Other...>
{
return Response<Type>::parse(std::move(response));
}

// Peel off nullable modifiers.
template <TypeModifier Modifier, TypeModifier... Other>
[[nodiscard]] static inline std::optional<typename ResponseTraits<Type, Other...>::type> parse(
[[nodiscard]] static std::optional<typename ResponseTraits<Type, Other...>::type> parse(
response::Value&& response) requires NullableModifier<Modifier>
{
if (response.type() == response::Type::Null)
Expand All @@ -318,7 +318,7 @@ struct ModifiedResponse

// Peel off list modifiers.
template <TypeModifier Modifier, TypeModifier... Other>
[[nodiscard]] static inline std::vector<typename ResponseTraits<Type, Other...>::type> parse(
[[nodiscard]] static std::vector<typename ResponseTraits<Type, Other...>::type> parse(
response::Value&& response) requires ListModifier<Modifier>
{
std::vector<typename ResponseTraits<Type, Other...>::type> result;
Expand Down
22 changes: 11 additions & 11 deletions include/graphqlservice/GraphQLResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,42 +392,42 @@ class [[nodiscard]] Writer final
template <class T>
struct Model : Concept
{
inline Model(std::unique_ptr<T>&& pimpl)
Model(std::unique_ptr<T>&& pimpl)
: _pimpl { std::move(pimpl) }
{
}

inline void start_object() const final
void start_object() const final
{
_pimpl->start_object();
}

inline void add_member(const std::string& key) const final
void add_member(const std::string& key) const final
{
_pimpl->add_member(key);
}

inline void end_object() const final
void end_object() const final
{
_pimpl->end_object();
}

inline void start_array() const final
void start_array() const final
{
_pimpl->start_array();
}

inline void end_arrary() const final
void end_arrary() const final
{
_pimpl->end_arrary();
}

inline void write_null() const final
void write_null() const final
{
_pimpl->write_null();
}

inline void write_string(const std::string& value) const final
void write_string(const std::string& value) const final
{
_pimpl->write_string(value);
}
Expand All @@ -437,12 +437,12 @@ class [[nodiscard]] Writer final
_pimpl->write_bool(value);
}

inline void write_int(int value) const final
void write_int(int value) const final
{
_pimpl->write_int(value);
}

inline void write_float(double value) const final
void write_float(double value) const final
{
_pimpl->write_float(value);
}
Expand All @@ -455,7 +455,7 @@ class [[nodiscard]] Writer final

public:
template <class T>
inline Writer(std::unique_ptr<T> writer)
Writer(std::unique_ptr<T> writer)
: _concept { std::static_pointer_cast<const Concept>(
std::make_shared<Model<T>>(std::move(writer))) }
{
Expand Down
Loading