Pārlūkot izejas kodu

Add vector to to_string method of Any

Eric Ramat 7 gadi atpakaļ
vecāks
revīzija
45e2eebaf5
1 mainītis faili ar 25 papildinājumiem un 1 dzēšanām
  1. 25 1
      src/artis/kernel/Any.hpp

+ 25 - 1
src/artis/kernel/Any.hpp

@@ -202,7 +202,31 @@ public:
                     if (q_bool) {
                         return o->*(q_bool->value_) ? "true": "false";
                     } else {
-                        return "NA";
+                        data < T, std::vector < double > >* q_double_v =
+                            dynamic_cast < data < T, std::vector <
+                                double > >* >(ptr_);
+
+                        if (q_double_v) {
+                            return "";
+                        } else {
+                            data < T, std::vector < int > >* q_int_v =
+                                dynamic_cast < data < T, std::vector <
+                                    int > >* >(ptr_);
+
+                            if (q_int_v) {
+                                return "";
+                            } else {
+                                data < T, std::vector < bool > >* q_bool_v =
+                                    dynamic_cast < data < T, std::vector <
+                                        bool > >* >(ptr_);
+
+                                if (q_bool_v) {
+                                    return "";
+                                } else {
+                                    return "NA";
+                                }
+                            }
+                        }
                     }
                 }
             }