From: Foster T. B. <fbr...@ad...> - 2005-04-29 18:15:41
|
The line wouldn't compile on Metrowerks, either. I put in a similar fix to David's (except I didn't have my stream as static) and everything is working fine for me. I've checked it in to the repository. The compiler error has to do with the fact that the std::istream& parameter isn't const. It's eluding me at the moment, but the problem deals with something like C++ compilers shouldn't allow the manipulation of temporary variables. In the case below the name of the file (const char* from c_str) was being used to construct a temporary std::ifstream, whose reference was then being passed to make_view, and I don't think compiler should like this. If the std::ifstream parameter was a const std::ifstream& the compiler would allow it, but then you wouldn't be able to manipulate the stream. David's fix (without the static keyword) is, I believe, the correct one. Blessings, Foster On Apr 28, 2005, at 03:15p, David Catmull wrote: > I made this change in express_viewer.cpp (starting at line 131): > > static std::ifstream editor_stream_s(editor_eve.c_str()); > static adobe::auto_ptr<eve_client::eve_client_holder> editor_view_s( > eve_client::make_view( editor_eve.c_str(), > editor_stream_s,//std::ifstream(editor_eve.c_str()), > editor_sheet_s, > [snip] > > to fix this: > > /Users/uncommon/Developer/ASL/sandbox/adobe-source/adobe/test/visual/ > sources/express_viewer.cpp:141: error: could not convert > `ifstream((&editor_eve)->std::basic_string<_CharT, _Traits, > _Alloc>::c_str() const [with _CharT = char, _Traits = > std::char_traits<char>, _Alloc = std::allocator<char>](), > (std::_Ios_Openmode)8)' to `std::istream&' > > ...but that gets me an infinite recursion situation in Begin that has > been difficult to track down. But maybe I won't have to if there's a > different fix for the above error :) > > -- > David Catmull > unc...@un... > http://www.uncommonplace.com/ > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > _______________________________________________ > Adobe-source-devel mailing list > Ado...@li... > https://lists.sourceforge.net/lists/listinfo/adobe-source-devel > > -- Foster T. Brereton <}}}>< Romans 3:21-26 A d o b e S o f t w a r e T e c h n o l o g y L a b "What 99 percent of programmers need to know is not how to build components but how to use them." -- Alexander Stepanov |