*/
List (const List &other);
- /**
- * Destructor.
- */
- virtual ~List ();
-
/**
* Return <tt>true</tt> if the string is a comma-separated list of strings
* each of which match the pattern given to the constructor.
/**
* Copy of the pattern that each element of the list has to satisfy.
*/
- PatternBase *pattern;
+ std::unique_ptr<PatternBase> pattern;
/**
* Minimum number of elements the list must have.
*/
Map (const Map &other);
- /**
- * Destructor.
- */
- virtual ~Map ();
-
/**
* Return <tt>true</tt> if the string is a comma-separated list of strings
* each of which match the pattern given to the constructor.
* Copy of the patterns that each key and each value of the map has to
* satisfy.
*/
- PatternBase *key_pattern;
- PatternBase *value_pattern;
+ std::unique_ptr<PatternBase> key_pattern;
+ std::unique_ptr<PatternBase> value_pattern;
/**
* Minimum number of elements the list must have.
- List::~List ()
- {
- delete pattern;
- pattern = nullptr;
- }
-
-
-
bool List::match (const std::string &test_string_list) const
{
std::string tmp = test_string_list;
- Map::~Map ()
- {
- delete key_pattern;
- key_pattern = nullptr;
-
- delete value_pattern;
- value_pattern = nullptr;
- }
-
-
-
bool Map::match (const std::string &test_string_list) const
{
std::string tmp = test_string_list;