From 1f5cc56fd91d22c7c7cf1eeb61c92869d2268d36 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Wed, 14 Dec 2016 22:56:26 +0100 Subject: [PATCH] add Label to Symbol constructor --- alib2data/src/alphabet/Symbol.cpp | 9 ++++++--- alib2data/src/alphabet/Symbol.h | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/alib2data/src/alphabet/Symbol.cpp b/alib2data/src/alphabet/Symbol.cpp index 54e812036b..9d5828dbb7 100644 --- a/alib2data/src/alphabet/Symbol.cpp +++ b/alib2data/src/alphabet/Symbol.cpp @@ -15,13 +15,16 @@ void Symbol::inc ( ) { this->operator ++ ( ); } -Symbol::Symbol ( int number ) : alib::WrapperBase < SymbolBase > ( alphabet::LabeledSymbol { label::Label ( number ) } ) { +Symbol::Symbol ( label::Label label ) : alib::WrapperBase < SymbolBase > ( alphabet::LabeledSymbol { std::move ( label ) } ) { } -Symbol::Symbol ( char character ) : alib::WrapperBase < SymbolBase > ( alphabet::LabeledSymbol { label::Label ( character ) } ) { +Symbol::Symbol ( int number ) : Symbol ( label::Label ( number ) ) { } -Symbol::Symbol ( std::string string ) : alib::WrapperBase < SymbolBase > ( alphabet::LabeledSymbol { label::Label ( std::move ( string ) ) } ) { +Symbol::Symbol ( char character ) : Symbol ( label::Label ( character ) ) { +} + +Symbol::Symbol ( std::string string ) : Symbol ( label::Label ( std::move ( string ) ) ) { } Symbol::Symbol ( const char * string ) : Symbol ( ( std::string ) string ) { diff --git a/alib2data/src/alphabet/Symbol.h b/alib2data/src/alphabet/Symbol.h index 70d64bae13..6a2012e6d8 100644 --- a/alib2data/src/alphabet/Symbol.h +++ b/alib2data/src/alphabet/Symbol.h @@ -14,6 +14,8 @@ #include <set> #include <string> +#include <label/Label.h> + namespace alphabet { /** @@ -23,6 +25,7 @@ class Symbol : public alib::WrapperBase < SymbolBase > { using alib::WrapperBase < SymbolBase >::WrapperBase; public: + explicit Symbol ( label::Label label ); explicit Symbol ( int number ); explicit Symbol ( char character ); explicit Symbol ( std::string string ); -- GitLab