reglibcpp  1.3.0
(Naïve) C++ implementation of models for regular languages
Classes | Functions
dfa.h File Reference

Contains the reg::dfa class definition. More...

#include <memory>
#include <vector>
#include <valarray>
#include <string>
#include <locale>
#include <codecvt>

Go to the source code of this file.

Classes

class  reg::dfa
 Represents deterministic finite automata. More...
 
class  reg::dfa::builder
 Constructs DFAs step by step. More...
 

Functions

template<class T >
size_t reg::index_of (vector< T > const &vec, T const &element)
 Basically Java's List interface's indexOf, but as a non-member function and returning the container's size upon failure. More...
 
template size_t reg::index_of (vector< char32_t > const &vec, char32_t const &element)
 Explicit instantiation for use in other translation units. More...
 

Detailed Description

Contains the reg::dfa class definition.

Definition in file dfa.h.

Function Documentation

◆ index_of() [1/2]

template<class T >
size_t reg::index_of ( vector< T > const &  vec,
T const &  element 
)

Basically Java's List interface's indexOf, but as a non-member function and returning the container's size upon failure.

Parameters
vecthe container to search through
elementthe element to find the index of
Returns
the first i with vec[i]==element or vec.size() if none is found

Definition at line 995 of file dfa.cpp.

995  {
996  return static_cast<size_t>(std::distance(vec.begin(), find(vec.begin(), vec.end(), element)));
997 }

◆ index_of() [2/2]

template size_t reg::index_of ( vector< char32_t > const &  vec,
char32_t const &  element 
)

Explicit instantiation for use in other translation units.