| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11
Comments:
<0> i just want a template cl***<T> that will insert some values into a hash_map<T,T> <1> There's no T2 declared in line 24. Where do you expect it to come from? <2> oh, i'm guessing it's all one file <1> The error message looks pretty obvious to me. <3> actually, I guess it's a one line file, but it demonstrates the problem <2> why can't you just use a hash_map<T,T> ? <0> _m_ sorry... in the prevous code i used T.. that not the error.
<2> it likely has some function to insert a value <0> with hash_map<T,T> the error continues... <1> the compiler doesn't see any hash function for std::string. <2> i don't see the error message <0> ../MySite.cpp:28: instantiated from `void C<T>::insert(T, T) [with T = std::string]' <0> ../MySite.cpp:38: instantiated from here <2> forget about C <2> what's the problem with using a hash_map ? <3> they're not standard.....yet <1> And they're not portable, either. <0> _m_ maybe thats the problem.. with int it compiles.. <1> s/maybe// <1> add this to your code when using gcc: namespace __gnu_cxx { template<> struct hash<std::string> { size_t operator()(std::string const &s) const { return hash<char const *>()(s.c_str()); } }; } <1> You should make sure to #include <string> when you use std::string, btw. <0> _m_ many thanks!!! i will do that! <0> ehhehe no errors... you are the man! <3> _m_ you got a minute to test something? <1> sure <3> #include "boost/filesystem/path.hpp" <3> put that in a c++ source file and try to compile with all the "conformance" options turned on <3> I'm getting 5 warnings <3> "level 1 warnings.... the ones that you can turn off only if you turn them all off <1> I don't get any with g++ -W -Wall -Werror -ansi -pedantic <3> c:\boost\include\boost-1_34\boost\filesystem\path.hpp(281) : warning C4180: qualifier applied to function type has no meaning; ignored <3> ok, thanks <3> it might be a compiler bug <sigh>
<1> Even no warning with -Weffc++ <3> well it's odd because line 281 is essentially the same as line 280 which does NOT get the warning <3> it's bitching about some const on some of the methods <1> hmm ... are talking about CVS head? <1> I tested against 1.33.1 <3> yup <3> it's after 1.33.1 <3> I even know what revision starts causing the "problem" <3> revision 1.16 <3> date: 2005/12/16 16:40:34; author: beman_dawes; state: Exp; lines: +1278 -93 <3> merge from i18n branch - at last! <1> +1278 ... holy **** <3> yeah <3> I noticed that <3> I hope I don't need that many if/when I do some i18n <3> I'm trying to figure out why I didn't notice it before yesterday <1> no warnings for the new code, either. <3> ok, must be vc8 <3> const string_type & string() const { return m_path; } <3> const string_type file_string() const; <3> const string_type directory_string() const { return file_string(); } <3> there are lines 280, 281, 282 <3> gets warnings on 81,82 <1> The warnings are valid. The const on the return type is odd. <1> I think these two consts make some sense, in this special case, though. The make the interface of file_string() and directory_string() consistent with string(). <1> lovely <1> I own the channel now. <0> heeheh
Return to
#c++ or Go to some related
logs:
#AllNiteCafe #linux #AllNiteCafe Shitzo dogs #php activewidget tabs size
#skype #c++ #linux sun v40z iommu
|
|