| 670 | } |
| 671 | |
| 672 | std::string TD_TL_writer_cpp::gen_constructor_field_init(int field_num, const std::string &class_name, const tl::arg &a, |
| 673 | bool is_default) const { |
| 674 | std::string field_type = gen_field_type(a); |
| 675 | if (field_type.empty()) { |
| 676 | return ""; |
| 677 | } |
| 678 | std::string move_begin; |
| 679 | std::string move_end; |
| 680 | if ((field_type == bytes_type || field_type == secure_bytes_type || field_type == secure_string_type || |
| 681 | field_type.compare(0, 11, "std::vector") == 0 || field_type.compare(0, 10, "object_ptr") == 0) && |
| 682 | !is_default) { |
| 683 | move_begin = "std::move("; |
| 684 | move_end = ")"; |
| 685 | } |
| 686 | |
| 687 | return (field_num == 0 ? ")\n : " : " , ") + gen_field_name(a.name) + "(" + move_begin + |
| 688 | (is_default ? "" : gen_field_name(a.name)) + move_end + ")\n"; |
| 689 | } |
| 690 | |
| 691 | std::string TD_TL_writer_cpp::gen_constructor_end(const tl::tl_combinator *t, int fields_num, bool is_default) const { |
| 692 | if (fields_num == 0) { |
nothing calls this directly
no outgoing calls
no test coverage detected