summaryrefslogtreecommitdiffstats
path: root/fsa
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-07 11:16:08 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-10-07 11:16:35 +0000
commit9bb9d8e14827ecc4dba2d43e2d9e76248c120e1d (patch)
tree9e64c1471c0391410c824f75e2dc1fbfa8585229 /fsa
parentf2e89d3361cae0e2e74bac89405a175d6ecf5e98 (diff)
Add noexcept as indicated by -Wnoeexcept
Diffstat (limited to 'fsa')
-rw-r--r--fsa/src/vespa/fsa/fsa.h26
-rw-r--r--fsa/src/vespa/fsa/segmenter.h8
2 files changed, 17 insertions, 17 deletions
diff --git a/fsa/src/vespa/fsa/fsa.h b/fsa/src/vespa/fsa/fsa.h
index e4d3246d924..9c668f1f85f 100644
--- a/fsa/src/vespa/fsa/fsa.h
+++ b/fsa/src/vespa/fsa/fsa.h
@@ -304,7 +304,7 @@ public:
*
* @param f Reference to FSA.
*/
- State(const FSA& f) : _fsa(&f), _state(_fsa->start()) {}
+ State(const FSA& f) noexcept : _fsa(&f), _state(_fsa->start()) {}
/**
* @brief Constructor.
@@ -314,7 +314,7 @@ public:
*
* @param f Pointer to FSA.
*/
- State(const FSA* f) : _fsa(f), _state(_fsa->start()) {}
+ State(const FSA* f) noexcept : _fsa(f), _state(_fsa->start()) {}
/**
* @brief Copy constructor.
@@ -325,14 +325,14 @@ public:
*
* @param s Reference to state to be duplicated.
*/
- State(const State& s) : _fsa(s._fsa), _state(s._state) {}
+ State(const State& s) noexcept : _fsa(s._fsa), _state(s._state) {}
/**
* @brief Destructor.
*
* Destructor, does nothing special.
*/
- virtual ~State() {}
+ virtual ~State() = default;
/**
* @brief Check if the automaton has perfect hash built in.
@@ -1043,7 +1043,7 @@ public:
*
* @param f Reference to FSA.
*/
- WordCounterState(const FSA& f) : State(f), _counter(0) {}
+ WordCounterState(const FSA& f) noexcept : State(f), _counter(0) {}
/**
* @brief Constructor.
@@ -1053,7 +1053,7 @@ public:
*
* @param f Pointer to FSA.
*/
- WordCounterState(const FSA* f) : State(f), _counter(0) {}
+ WordCounterState(const FSA* f) noexcept : State(f), _counter(0) {}
/**
* @brief Copy constructor.
@@ -1062,12 +1062,12 @@ public:
*
* @param s Reference to hashed state to copy.
*/
- WordCounterState(const WordCounterState& s) : State(s), _counter(s._counter) {}
+ WordCounterState(const WordCounterState& s) noexcept : State(s), _counter(s._counter) {}
/**
* @brief Destructor.
*/
- virtual ~WordCounterState() {}
+ virtual ~WordCounterState() = default;
/**
* @brief Set the state to the starting state of the automaton.
@@ -1798,7 +1798,7 @@ public:
*
* @param f Reference to FSA.
*/
- HashedWordCounterState(const FSA& f) : State(f), _hash(0), _counter(0) {}
+ HashedWordCounterState(const FSA& f) noexcept : State(f), _hash(0), _counter(0) {}
/**
* @brief Constructor.
@@ -1808,7 +1808,7 @@ public:
*
* @param f Pointer to FSA.
*/
- HashedWordCounterState(const FSA* f) : State(f), _hash(0), _counter(0) {}
+ HashedWordCounterState(const FSA* f) noexcept : State(f), _hash(0), _counter(0) {}
/**
* @brief Copy constructor.
@@ -1817,12 +1817,12 @@ public:
*
* @param s Reference to hashed state to copy.
*/
- HashedWordCounterState(const HashedWordCounterState& s) : State(s), _hash(s._hash), _counter(s._counter) {}
+ HashedWordCounterState(const HashedWordCounterState& s) noexcept : State(s), _hash(s._hash), _counter(s._counter) {}
/**
* @brief Destructor.
*/
- virtual ~HashedWordCounterState() {}
+ virtual ~HashedWordCounterState() = default;
/**
* @brief Set the state to the starting state of the automaton.
@@ -2120,7 +2120,7 @@ public:
*
* @return Index of the start state (0 if the %FSA is empty).
*/
- state_t start() const
+ state_t start() const noexcept
{
return _start;
}
diff --git a/fsa/src/vespa/fsa/segmenter.h b/fsa/src/vespa/fsa/segmenter.h
index a2720c6de0c..f2826f9c967 100644
--- a/fsa/src/vespa/fsa/segmenter.h
+++ b/fsa/src/vespa/fsa/segmenter.h
@@ -147,7 +147,7 @@ public:
*
* Null segment at postion zero.
*/
- Segment() : _beg(0), _end(0), _conn(0) {}
+ Segment() noexcept : _beg(0), _end(0), _conn(0) {}
/**
* @brief Constructor.
@@ -156,7 +156,7 @@ public:
* @param e End of the segment (the position after the last term).
* @param c Connexity of the segment.
*/
- Segment(unsigned int b, unsigned int e, unsigned int c) :
+ Segment(unsigned int b, unsigned int e, unsigned int c) noexcept :
_beg(b), _end(e), _conn(c) {}
/**
@@ -164,12 +164,12 @@ public:
*
* @param s Segment object to copy.
*/
- Segment(const Segment &s) : _beg(s._beg), _end(s._end), _conn(s._conn) {}
+ Segment(const Segment &s) noexcept : _beg(s._beg), _end(s._end), _conn(s._conn) {}
/**
* @brief Destructor.
*/
- ~Segment() {}
+ ~Segment() = default;
/**
* @brief Set the segment parameters.