Index: src/Parameters/Validators/DiscreteValidator.hpp
===================================================================
--- src/Parameters/Validators/DiscreteValidator.hpp	(revision 047cad4ca87588045ffa9ab6a34544fb3d8b567f)
+++ src/Parameters/Validators/DiscreteValidator.hpp	(revision 9b5eb03b7cad5e1f2494b404dc68e986b56b0718)
@@ -29,33 +29,16 @@
   virtual ~DiscreteValidator() {};
 
-  bool isValid(const T & _value) const
-  {
-    typename std::vector<T>::const_iterator iter = std::find(ValidValues.begin(), ValidValues.end(), _value);
-    if (iter != ValidValues.end()) {
-      //std::cout << "Found " << _value << ":" << *iter << std::endl;
-      return true;
-    } else {
-      //std::cout << "Did not find " << _value << "." << std::endl;
-      return false;
-    }
-  }
+  bool isValid(const T & _value) const;
 
-  Validator<T>* clone() const { return new DiscreteValidator<T>(ValidValues); };
+  Validator<T>* clone() const;
 
   // comparator
-  bool operator==(const Validator<T> &_instance) const
-  {
-    const DiscreteValidator<T> *inst = dynamic_cast<const DiscreteValidator<T> *>(&_instance);
-    if (inst)
-      return ValidValues == inst->ValidValues;
-    return false;
-  };
+  bool operator==(const Validator<T> &_instance) const;
 
-  void appendValidValue(const T &_value)
-  {
-    ASSERT(!isValid(_value),
-        "DiscreteValidator<>::appendValidValue() - value "+toString(_value)+" is already among the valid");
-    ValidValues.push_back(_value);
-  }
+  void appendValidValue(const T &_value);
+  const std::vector<T> &getValidValues() const;
+
+private:
+  const size_t findIndexOfValue(const T &_value) const;
 
 private:
@@ -64,4 +47,5 @@
 };
 
+#include "DiscreteValidator_impl.hpp"
 
 #endif /* DISCRETEVALIDATOR_HPP_ */
Index: src/Parameters/Validators/DiscreteValidator_impl.hpp
===================================================================
--- src/Parameters/Validators/DiscreteValidator_impl.hpp	(revision 9b5eb03b7cad5e1f2494b404dc68e986b56b0718)
+++ src/Parameters/Validators/DiscreteValidator_impl.hpp	(revision 9b5eb03b7cad5e1f2494b404dc68e986b56b0718)
@@ -0,0 +1,78 @@
+/*
+ * DiscreteValidator_impl.hpp
+ *
+ *  Created on: Apr 16, 2012
+ *      Author: ankele
+ */
+
+#ifndef DISCRETEVALIDATOR_IMPL_HPP_
+#define DISCRETEVALIDATOR_IMPL_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+template <class T>
+bool DiscreteValidator<T>::isValid(const T & _value) const
+{
+  typename std::vector<T>::const_iterator iter = std::find(ValidValues.begin(), ValidValues.end(), _value);
+  if (iter != ValidValues.end()) {
+    //std::cout << "Found " << _value << ":" << *iter << std::endl;
+    return true;
+  } else {
+    //std::cout << "Did not find " << _value << "." << std::endl;
+    return false;
+  }
+}
+
+template <class T>
+Validator<T>* DiscreteValidator<T>::clone() const
+{
+  return new DiscreteValidator<T>(ValidValues);
+};
+
+
+template <class T>
+bool DiscreteValidator<T>::operator==(const Validator<T> &_instance) const
+{
+  const DiscreteValidator<T> *inst = dynamic_cast<const DiscreteValidator<T> *>(&_instance);
+  if (inst)
+    return ValidValues == inst->ValidValues;
+  return false;
+};
+
+template <class T>
+void DiscreteValidator<T>::appendValidValue(const T &_value)
+{
+  ASSERT(!isValid(_value),
+      "DiscreteValidator<>::appendValidValue() - value "+toString(_value)+" is already among the valid");
+  ValidValues.push_back(_value);
+}
+
+/** Internal function for finding the index of a desired value.
+ *
+ * \note As this is internal, we do not ASSERT value's presence, but return -1
+ * such that other functions may ASSERT on that.
+ *
+ * \param _value value to get the index of
+ * \return index such that ValidValues[index] == _value
+ */
+template <class T>
+const size_t DiscreteValidator<T>::findIndexOfValue(const T &_value) const
+{
+  size_t index = 0;
+  const size_t max = ValidValues.size();
+  for (; index < max; ++index) {
+    if (ValidValues[index] == _value)
+      break;
+  }
+  if (index == max)
+    return (size_t)-1;
+  else
+    return index;
+}
+
+
+#endif /* DISCRETEVALIDATOR_IMPL_HPP_ */
Index: src/Parameters/unittests/Makefile.am
===================================================================
--- src/Parameters/unittests/Makefile.am	(revision 047cad4ca87588045ffa9ab6a34544fb3d8b567f)
+++ src/Parameters/unittests/Makefile.am	(revision 9b5eb03b7cad5e1f2494b404dc68e986b56b0718)
@@ -68,4 +68,5 @@
 	../Parameters/unittests/DiscreteValueTest.hpp \
 	../Parameters/Validators/DiscreteValidator.hpp \
+	../Parameters/Validators/DiscreteValidator_impl.hpp \
 	../Parameters/Validators/DummyValidator.hpp \
 	../Parameters/Validators/Validator.hpp \
@@ -80,4 +81,5 @@
 	../Parameters/unittests/DiscreteParameterTest.hpp \
 	../Parameters/Validators/DiscreteValidator.hpp \
+	../Parameters/Validators/DiscreteValidator_impl.hpp \
 	../Parameters/Validators/DummyValidator.hpp \
 	../Parameters/Validators/Validator.hpp \
