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 7764113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:49:44+00:00 2026-06-01T14:49:44+00:00

We can initialize a container deque by using standard input like this: deque<int> c((istream_iterator<int>(cin)),(istream_iterator<int>()));

  • 0

We can initialize a container deque by using standard input like this:

deque<int> c((istream_iterator<int>(cin)),(istream_iterator<int>()));

As 《The C++ Standard Library》 describes,the extra parentheses around the initializer arguments are necessary.Without them ,c declares a function with a return type that is deque.Its first parameter is of type istream_iterator with the name cin,and its second unnamed parameter is of type “function taking no arguments returning istream_iterator”.Look the following code

deque<int> c(istream_iterator<int>(cin),istream_iterator<int>());

But teh extra parentheses force the initializer not to match the syntax of a declaration.
I don’t understand why the extra parentheses can make the initializer not to match syntax of a declaration.Thanks a lot.

  • 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-06-01T14:49:45+00:00Added an answer on June 1, 2026 at 2:49 pm

    Because the grammar defined in the C++ standard does not accept this form as a function declaration:

    T name((U), (V));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While using this code, i can't get any results... Ext.define('Teste.view.Main', { extend: 'Ext.Container', initialize:
Can we initialize Python objects with statement like this: a = b = c
In c# I can initialize a List at creation time like var list =
Using C# 3.0, we can initialize objects without their constructors for syntactical reasons. Such
I would like to know: how can i initialize class object with parameters? I've
Can I declare an int array, then initialize it with chars? I'm trying to
Using a DI container (in this case, Ninject ) is it possible - -
There are several different ways I can initialize complex objects (with injected dependencies and
How do I know when my GUI is ready, so I can initialize my
I can't figure out the proper block initialize class Foo attr_accessor :bar end obj

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.