Commit 1d7a098b authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

Ainur: vector of string

parent 66d0e4ed
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -240,7 +240,8 @@ private:
	void convertInternal(std::vector<T>& t,
	                     String value,
	                     typename EnableIf<Loki::TypeTraits<T>::isArith ||
	                     IsComplexNumber<T>::True,
	                     IsComplexNumber<T>::True ||
	                     TypesEqual<T, String>::True,
	                     int>::Type = 0) const;

	template<typename T>
+4 −1
Original line number Diff line number Diff line
@@ -292,7 +292,8 @@ template<typename T>
void AinurState::convertInternal(std::vector<T>& t,
                                 String value,
                                 typename EnableIf<Loki::TypeTraits<T>::isArith ||
                                 IsComplexNumber<T>::True,
                                 IsComplexNumber<T>::True ||
                                 TypesEqual<T, String>::True,
                                 int>::Type) const
{
	namespace qi = boost::spirit::qi;
@@ -337,4 +338,6 @@ int) const;
template void AinurState::convertInternal(std::vector<SizeType>&, String, int) const;

template void AinurState::convertInternal(std::vector<int>&, String, int) const;

template void AinurState::convertInternal(std::vector<String>&, String, int) const;
} // namespace PsimagLite
+9 −1
Original line number Diff line number Diff line
@@ -926,13 +926,21 @@ public:
		}

		template<typename ComplexOrRealType>
		typename EnableIf<!IsComplexNumber<ComplexOrRealType>::True,
		typename EnableIf<!IsComplexNumber<ComplexOrRealType>::True &&
		Loki::TypeTraits<ComplexOrRealType>::isArith,
		typename Real<ComplexOrRealType>::Type>::Type
		stringToComplexOrReal(const String& s) const
		{
			return static_cast<typename Real<ComplexOrRealType>::Type>(stringToReal(s));
		}

		template<typename ComplexOrRealType>
		typename EnableIf<TypesEqual<ComplexOrRealType,String>::True, String>::Type
		stringToComplexOrReal(const String& s) const
		{
			return s;
		}

		double stringToReal(const String& s) const
		{
			for (SizeType i = 0; i < s.length(); ++i) {