From 5c5491405ecae19eff4589c26570d4b56a5bdd38 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 1 Sep 2017 17:21:50 +0700 Subject: [PATCH] Make LineAndColumn an aggregate as well --- src/coord.hh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/coord.hh b/src/coord.hh index aa2f0e54..06c1032d 100644 --- a/src/coord.hh +++ b/src/coord.hh @@ -10,12 +10,8 @@ namespace Kakoune template struct LineAndColumn { - LineType line; - ColumnType column; - - [[gnu::always_inline]] - constexpr LineAndColumn(LineType line = 0, ColumnType column = 0) - : line(line), column(column) {} + LineType line = 0; + ColumnType column = 0; [[gnu::always_inline]] constexpr EffectiveType operator+(EffectiveType other) const @@ -95,14 +91,14 @@ struct BufferCoord : LineAndColumn { [[gnu::always_inline]] constexpr BufferCoord(LineCount line = 0, ByteCount column = 0) - : LineAndColumn(line, column) {} + : LineAndColumn{line, column} {} }; struct DisplayCoord : LineAndColumn { [[gnu::always_inline]] constexpr DisplayCoord(LineCount line = 0, ColumnCount column = 0) - : LineAndColumn(line, column) {} + : LineAndColumn{line, column} {} static constexpr const char* option_type_name = "coord"; }; @@ -111,11 +107,11 @@ struct BufferCoordAndTarget : BufferCoord { [[gnu::always_inline]] constexpr BufferCoordAndTarget(LineCount line = 0, ByteCount column = 0, ColumnCount target = -1) - : BufferCoord(line, column), target(target) {} + : BufferCoord{line, column}, target{target} {} [[gnu::always_inline]] constexpr BufferCoordAndTarget(BufferCoord coord, ColumnCount target = -1) - : BufferCoord(coord), target(target) {} + : BufferCoord{coord}, target{target} {} ColumnCount target; };