summaryrefslogtreecommitdiffstats
path: root/vec_pseudo.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-03-21 12:59:13 -0400
committerErik Schnetter <schnetter@gmail.com>2013-03-21 12:59:13 -0400
commit4272d8f94dd4c4b00ef42778c5c5255cfb94feba (patch)
tree54718092f44656b5be7770b5fb0e57bc1aef7bb0 /vec_pseudo.h
parentb5b2be38fe26632e51b42e60a3cb9714576a9a5a (diff)
downloadvecmathlib-4272d8f94dd4c4b00ef42778c5c5255cfb94feba.zip
vecmathlib-4272d8f94dd4c4b00ef42778c5c5255cfb94feba.tar.gz
Don't use typeinfo
Diffstat (limited to 'vec_pseudo.h')
-rw-r--r--vec_pseudo.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/vec_pseudo.h b/vec_pseudo.h
index 074491f..31d9cbb 100644
--- a/vec_pseudo.h
+++ b/vec_pseudo.h
@@ -10,10 +10,10 @@
#include <algorithm>
#include <cmath>
#include <string>
-#include <typeinfo>
#include <sstream>
+
namespace vecmathlib {
template<typename T, int N> struct boolpseudovec;
@@ -378,14 +378,10 @@ namespace vecmathlib {
static char const* name()
{
static std::string name_;
- if (name_.length()==0) {
- std::string base;
- if (typeid(T) == typeid(float)) base = "float";
- else if (typeid(T) == typeid(double)) base = "double";
- else base = typeid(T).name();
- stringstream ss;
- ss << "<libm:" << N << "*" << base << ">";
- name_ = ss.str();
+ if (name_.empty()) {
+ stringstream buf;
+ buf << "<libm:" << N << "*" << FP::name() << ">";
+ name_ = buf.str();
}
return name_.c_str();
}
OpenPOWER on IntegriCloud