Skip to content

Commit

Permalink
Moved the use of methods marked constexpr from the 20th standard to f…
Browse files Browse the repository at this point in the history
…orward declared types
  • Loading branch information
4JustMe4 authored and levlam committed May 17, 2024
1 parent d75adbf commit fd3154b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 7 additions & 0 deletions tdutils/td/utils/JsonBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,13 @@ Slice JsonValue::get_type_name(Type type) {
}
}

JsonObject::JsonObject(vector<std::pair<Slice, JsonValue>> &&field_values) : field_values_(std::move(field_values)) {
}

size_t JsonObject::field_count() const {
return field_values_.size();
}

JsonValue JsonObject::extract_field(Slice name) {
for (auto &field_value : field_values_) {
if (field_value.first == name) {
Expand Down
7 changes: 2 additions & 5 deletions tdutils/td/utils/JsonBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,18 +464,15 @@ class JsonObject {

JsonObject() = default;

explicit JsonObject(vector<std::pair<Slice, JsonValue>> &&field_values) : field_values_(std::move(field_values)) {
}
explicit JsonObject(vector<std::pair<Slice, JsonValue>> &&field_values);

JsonObject(const JsonObject &) = delete;
JsonObject &operator=(const JsonObject &) = delete;
JsonObject(JsonObject &&) = default;
JsonObject &operator=(JsonObject &&) = default;
~JsonObject() = default;

size_t field_count() const {
return field_values_.size();
}
size_t field_count() const;

JsonValue extract_field(Slice name);

Expand Down

0 comments on commit fd3154b

Please sign in to comment.