Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation issue #20

Open
johnco3 opened this issue Jan 15, 2016 · 3 comments
Open

Compilation issue #20

johnco3 opened this issue Jan 15, 2016 · 3 comments

Comments

@johnco3
Copy link

johnco3 commented Jan 15, 2016

I get the following issue while trying to use the pretty print without modifications (I just renamed the file)

1>c:\main\dlmu\albfd\include\util\utlprettyprint.hpp(160): error C2061: syntax error: identifier 'ostream_type'
1> c:\main\dlmu\albfd\include\util\utlprettyprint.hpp(169): note: see reference to class template instantiation 'pretty_print::print_container_helper<T,TChar,TCharTraits,TDelimiters>::printerstd::pair<_Other1,_Other2>' being compiled
1>c:\main\dlmu\albfd\include\util\utlprettyprint.hpp(160): error C2238: unexpected token(s) preceding ';'
1>c:\main\dlmu\albfd\include\util\utlprettyprint.hpp(177): error C2061: syntax error: identifier 'ostream_type'
1> c:\main\dlmu\albfd\include\util\utlprettyprint.hpp(208): note: see reference to class template instantiation 'pretty_print::print_container_helper<T,TChar,TCharTraits,TDelimiters>::printerstd::tuple<_Types1...>' being compiled
1>c:\main\dlmu\albfd\include\util\utlprettyprint.hpp(177): error C2238: unexpected token(s) preceding ';'

@ImaginationWork
Copy link

The same to me. It appeared in VC14.

@toroidal-code
Copy link
Contributor

I had the same problem and resolved it like this:

diff --git a/prettyprint.hpp b/prettyprint.hpp
index 6bf2543..f75683c 100644
--- a/prettyprint.hpp
+++ b/prettyprint.hpp
@@ -157,7 +157,7 @@ namespace pretty_print
     template <typename T1, typename T2>
     struct print_container_helper<T, TChar, TCharTraits, TDelimiters>::printer<std::pair<T1, T2>>
     {
-        using ostream_type = print_container_helper<T, TChar, TCharTraits, TDelimiters>::ostream_type;
+        using ostream_type = typename print_container_helper<T, TChar, TCharTraits, TDelimiters>::ostream_type;

         static void print_body(const std::pair<T1, T2> & c, ostream_type & stream)
         {
@@ -174,7 +174,7 @@ namespace pretty_print
     template <typename ...Args>
     struct print_container_helper<T, TChar, TCharTraits, TDelimiters>::printer<std::tuple<Args...>>
     {
-        using ostream_type = print_container_helper<T, TChar, TCharTraits, TDelimiters>::ostream_type;
+        using ostream_type = typename print_container_helper<T, TChar, TCharTraits, TDelimiters>::ostream_type;
         using element_type = std::tuple<Args...>;

         template <std::size_t I> struct Int { };

@Alexander-Shukaev
Copy link

Closed?

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

No branches or pull requests

4 participants