underscore.hpp icon indicating copy to clipboard operation
underscore.hpp copied to clipboard

examples won't work

Open douyw opened this issue 9 years ago • 0 comments

The gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1). It seems there are three errors. The first one can be fixed easily. The others a little tricky. See below please.

me@iZ2510xo32iZ:~/labs/underscore.hpp/examples$ make
g++ -std=c++11 -g   -c -o services.o services.cpp
services.cpp: In function ‘void using_underscore()’:
services.cpp:67:37: error: no matching function for call to ‘underscore::file::file(std::ifstream)’
  file(std::ifstream("/etc/services"))
                                     ^
services.cpp:67:37: note: candidates are:
In file included from services.cpp:8:0:
../file.hpp:28:3: note: underscore::file::file(const string&)
   file(const std::string &filename) : ifs(new std::ifstream(filename, std::ifstream::in)) {
   ^
../file.hpp:28:3: note:   no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream<char>}’ to ‘const string& {aka const std::basic_string<char>&}’
In file included from services.cpp:8:0:
../file.hpp:24:8: note: underscore::file::file(underscore::file&&)
  class file : public generator<file>{
        ^
../file.hpp:24:8: note:   no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream<char>}’ to ‘underscore::file&&’
services.cpp:77:19: error: expected primary-expression before ‘>’ token
   .map<string_list>([](const string &s){  // Prepare pairs, {service, port/type}
                   ^
services.cpp:80:4: error: ‘struct using_underscore()::__lambda8’ has no member named ‘filter’
   .filter([](const string_list &t){ // Only tcp ports
    ^
make: *** [services.o] Error 1

douyw avatar Oct 28 '15 06:10 douyw