summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/struct_fields.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/struct_fields.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_fields.hh20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/struct_fields.hh b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
index 9a0225e..b8bb0a2 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_fields.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#ifndef EOLIAN_MONO_STRUCT_FIELDS_HH 16#ifndef EOLIAN_MONO_STRUCT_FIELDS_HH
2#define EOLIAN_MONO_STRUCT_FIELDS_HH 17#define EOLIAN_MONO_STRUCT_FIELDS_HH
3 18
@@ -30,8 +45,9 @@ struct field_argument_assignment_generator
30 template<typename OutputIterator, typename Context> 45 template<typename OutputIterator, typename Context>
31 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const 46 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
32 { 47 {
33 if (!as_generator("this." << string << " = " << string) 48 auto field_name = name_helpers::to_field_name(field.name);
34 .generate(sink, std::make_tuple(name_helpers::to_field_name(field.name), name_helpers::to_field_name(field.name)), context)) 49 if (!as_generator("this." << field_name << " = " << field_name)
50 .generate(sink, attributes::unused, context))
35 return false; 51 return false;
36 return true; 52 return true;
37 } 53 }