Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3460134
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:11:35+00:00 2026-05-18T10:11:35+00:00

I am using g++ in CodeBlocks IDE in Ubuntu. I am new to STL

  • 0

I am using g++ in CodeBlocks IDE in Ubuntu.
I am new to STL and some part of C++.

Q1: //answered

std::istream_iterator< std::string > begin ( dictionaryFile );
std::istream_iterator< std::string > end;
std::vector< std::string> dictionary;
std::copy ( begin, end, std::back_inserter ( dictionary ) );

is correct, but when I changed

std::istream_iterator< std::string > end;

into

std::istream_iterator< std::string > end();

the compiler says no matching function call at the fourth line.

Q2: //sorry i did not make the problem clear the first time

struct PS : std::pair< std::string, std::string > {
PS();
static struct FirstLess: std::binary_function< PS, PS, bool> {
    bool operator() ( const PS & p, const PS & q ) const {
        return p.first < q.first;
    }
} firstLess1; };


struct FirstLess: std::binary_function< PS, PS, bool> {
bool operator() ( const PS & p, const PS & q ) const {
    return p.first < q.first;
}} firstLess2;

Note that the only difference between firstLess1 and firstLess2 is that firstLess1 is declared in PS.

when I call the function :

k = std::find_if ( j + 1, finis, std::not1 ( std::bind1st ( PS::firstLess1, *j ) ) );

the compiler gave me an error ‘undefined reference to PS::firstLess1’.
and then I changed to

k = std::find_if ( j + 1, finis, std::not1 ( std::bind1st ( firstLess2, *j ) ) );

then it passed the compile.

More strange, in some other part of the program, i used both

j = std::adjacent_find ( j , finis, PS::firstLess1 );
j = std::adjacent_find ( j , finis, firstLess2 );

and the compiler did not gave me an error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:11:35+00:00Added an answer on May 18, 2026 at 10:11 am

    std::istream_iterator< std::string > end(); C++ interpretes this as declaration of function which name is end return value type is std::istream_iterator< std::string > and argument list is empty. Thats why you get such error. In C++ to make any object by calling default constructor of its class you just must do this type_name variable_name;. type_name variable_name(); will be interpreted as function declaration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following stringBuilder that I am using as part of Log4net log
I am working on learning the windows API and am using mingw as my
hi im trying to pass some values to a class but it wont let
I'm using Code::Blocks to build my project, which contains three files: main.cpp , TimeSeries.cpp
I'm quite new in C++ after few years in Java and eclipse, I got
If I use object initializers in using-block I get Code Analysis warning about not
I wonder if someone can help me. I'm using VS2010, .Net 4, EF4 and
How to configure mingw32 to cross-compile Direct3D Apps for Windows? Is there any possibility?
How can i access code behind methods from the radiobuttonlist insode the gridview below?
Is there any way/SW-tool that can be used to monitor a directory for changes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.