Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

votca-tools-1.2.3 fails to build with dev-libs/boost-1.53.0 #131

Closed
GoogleCodeExporter opened this issue Aug 18, 2015 · 2 comments
Closed

Comments

@GoogleCodeExporter
Copy link

See: <https://bugs.gentoo.org/show_bug.cgi?id=454104> and <
https://tinderboxlogs.s3.amazonaws.com/tbamd64.excelsior.flameeyes.eu/sci-libs%3
Avotca-tools-1.2.3%3A20130126-015723.html>

I could reproduce the problem only in combination with gcc-4.7. I guess it 
boils down to:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/include/g++-v4/bits/stl_algo.h:4940:5: 
note:   template argument deduction/substitution failed:
include/votca/tools/tokenizer.h:96:9: note: could not resolve address from 
overloaded function 'lexical_cast<int, std::string>'


Original issue reported on code.google.com by christop...@gmail.com on 26 Jan 2013 at 10:57

@GoogleCodeExporter
Copy link
Author

I think the problem is that boost introduced a version of lexical_cast for 
whole arrays and therefore boost::lexical_cast<T, std::string> is ambigious?

The following patch resolves the compilation issue but I didn't test yet if it 
breaks anything else. However it would be nice to find a way to still use 
std::transform / anything more elegant which is backward compatible.

--- a/include/votca/tools/tokenizer.h   Sun Dec 02 21:10:09 2012 -0700
+++ b/include/votca/tools/tokenizer.h   Sun Jan 27 03:09:10 2013 +0000
@@ -93,8 +93,10 @@
         std::vector<std::string> tmp;
         ToVector(tmp);
         v.resize(tmp.size());
-        transform(tmp.begin(), tmp.end(), v.begin(),
-            boost::lexical_cast<T, std::string>);
+        typename std::vector<T>::iterator viter = v.begin();
+        typename std::vector<std::string>::iterator iter;
+        for(iter = tmp.begin(); iter!=tmp.end(); ++iter, ++viter)
+            *viter = boost::lexical_cast<T, std::string>(*iter);
     }

 private:

Original comment by victor.r...@gmail.com on 27 Jan 2013 at 3:17

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision f26d7ee778d6.

Original comment by rue...@votca.org on 27 Jan 2013 at 3:56

  • Changed state: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant