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

Ainur: vector of string

parent 66d0e4ed
......@@ -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>
......
......@@ -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
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment