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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:06:55+00:00 2026-06-15T01:06:55+00:00

I was reading book template compelte guide , I section : 12.2.1 Signatures I

  • 0

I was reading book “template compelte guide” , I section : 12.2.1 Signatures I couldn’t understand a sentence of author :

Its return type, if the function is generated from a function template

what does the author means by “function generated by function template” ? , is he talking about template-id here? if so, why does return type matters in the case, since signature is defined by us?

A trivial example will be helpful, thanks.

  • 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-15T01:06:57+00:00Added an answer on June 15, 2026 at 1:06 am

    In section 12.2.1 the authors describe under which situations declarations of functions can coexist. The declaration of function templates can coexist even if they have a different return type, e.g., you can declare:

    template <typename T> int  f();
    tepmlate <typename T> char f();
    

    If you make these functions non-templates, you can’t even declare them. Of course, in the form above you won’t be able to call the function although you may be able to explicitly the select one of the functions using a cast (I’m not sure about this).

    The primary use of having functions with different return types coexist (although this wasn’t the original intent), is to remove some of these functions from the overload set based on condition, e.g.:

    template <typename T>
    typename std::enable_if<std::numeric_limits<T>::is_specialized, T>::type
    f(T); // used for types for which std::numeric_limits<T> is specialied
    
    template <typename T>
    typename std::enable_if<!std::numeric_limits<T>::is_specialized, T>::type
    f(T); // used for types for which std::numeric_limits<T> is not specialied
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading C++ Templates Complete Guide and came across this non-type function template
I was reading 'C++ Template complete guide' book, part about meta programming. There is
I am reading a book in which author used a code like this public
I'm reading the book Multithreading Applications in Win32 The book says return node->next will
So I'm reading the security chapter of Symfony2 Book. I understand everything, but I'd
Reading a book about C# I noticed that sometimes is mentioned value type and
While reading a book called Let us C I read that a function showbit()
I'm reading a book, the Primer guide to C++. I think I got the
Currently I am reading the book: Lions_Commentary_on_UNIX_6th_Edition, together I am trying to understand the
I'm reading book about OO programming in JavaScript and get some strange behaviour: function

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.