lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] building latest cvs with MSVC (PETE paths)


From: Vadim Zeitlin
Subject: [lmi] building latest cvs with MSVC (PETE paths)
Date: Fri, 19 Sep 2008 13:57:45 +0200

 Hello,

 I'm rebuilding latest cvs with MSVC and had 2 new problems:

1. My MSVC patch needs to be applied to the new functions in mc_enum.tpp:

--- mc_enum.tpp 2008-08-26 22:47:09 +0000
+++ mc_enum.tpp 2008-09-18 18:05:13 +0000
@@ -108,7 +108,7 @@
 }
 } // Unnamed namespace.

-template<typename T, std::size_t n, T const (&e)[n], char const*const (&c)[n]>
+template<typename T, std::size_t n, T const (*e)[n], char const*const (*c)[n]>
 std::istream& mc_enum<T,n,e,c>::read(std::istream& is)
 {
     std::locale old_locale = is.imbue(blank_is_not_whitespace_locale());
@@ -116,17 +116,17 @@
     is >> s;
     is.imbue(old_locale);

-    std::size_t v = std::find(c, c + n, s) - c;
+    std::size_t v = std::find(*c, *c + n, s) - *c;
     if(n == v)
         {
-        v = std::find(c, c + n, provide_for_backward_compatibility(s)) - c;
+        v = std::find(*c, *c + n, provide_for_backward_compatibility(s)) - *c;
         }
     if(n == v)
         {
         ordinal(s); // Throws.
         throw "Unreachable.";
         }
-    value_ = e[v];
+    value_ = (*e)[v];

     return is;
 }
@@ -212,10 +212,10 @@
     return (*c)[ordinal()];
 }

-template<typename T, std::size_t n, T const (&e)[n], char const*const (&c)[n]>
+template<typename T, std::size_t n, T const (*e)[n], char const*const (*c)[n]>
 std::vector<std::string> const& mc_enum<T,n,e,c>::all_strings()
 {
-    static std::vector<std::string> const v(c, c + n);
+    static std::vector<std::string> const v(*c, *c + n);
     return v;
 }

This simply does the same for them as had been done previously for the
other functions in this header.


2. I'm not sure how should the PETE files be organized. Currently loads.cpp
   contains "#include <PETE/et_vector.hpp>" and this doesn't work for me
   because the file et_vector.hpp is under tools/pete-2.1.1, i.e. not in
   PETE subdirectory at all. Shouldn't it be there?

 Thanks,
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]