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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:10:36+00:00 2026-06-01T16:10:36+00:00

These six methods (really three, the ones that actually throw the warning are the

  • 0

These six methods (really three, the ones that actually throw the warning are the non-const versions) are causing a C4717 (functions recursive on all paths) warning yet the method following these do not (exactly the same that I can tell…). What am I missing that is causing the warning for these but not the other one?

Warning-generating methods:

template<class T>
const QuadTreeNode<T>* QuadTree<T>::GetRoot() const {
    return _root;
}


template<class T>
QuadTreeNode<T>* QuadTree<T>::GetRoot() {
    return static_cast<const QuadTree<T> >(*this).GetRoot();
}

template<class T>
const int QuadTree<T>::GetNumLevels() const {
    return _levels;
}

template<class T>
int QuadTree<T>::GetNumLevels() {
    return static_cast<const QuadTree<T> >(*this).GetNumLevels();
}

template<class T>
const bool QuadTree<T>::IsEmpty() const {
    return _root == NULL;
}


template<class T>
bool QuadTree<T>::IsEmpty() {
    return static_cast<const QuadTree<T> >(*this).IsEmpty();
}

Non-Warning-generating method:

template<class T>
const Rectangle QuadTreeNode<T>::GetNodeDimensions() const {
    return _node_bounds;
}

template<class T>
Rectangle QuadTreeNode<T>::GetNodeDimensions() {
    return static_cast<const QuadTreeNode<T> >(*this).GetNodeDimensions();
}
  • 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-01T16:10:37+00:00Added an answer on June 1, 2026 at 4:10 pm

    As mentioned by ildjarn, the is an acknowledged bug with the warning. If you look at the code at the most basic usage similar of your code, there is no warning with the following (and is not recursive).

    class A
    {
    public:
        bool IsEmpty()
        {
            return static_cast<const A>(*this).IsEmpty();
        }
    
        bool IsEmpty() const
        {
            return true;
        }
    };
    
    int main()
    {
        A whatever;
        whatever.IsEmpty();
    
        return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page which has an Iframe. In that Iframe, there are six
These two methods exhibit repetition: public static Expression<Func<Foo, FooEditDto>> EditDtoSelector() { return f =>
I have some entities created with LINQ-to-SQL. Six of these entities (representing values primarily
I have created a grid view that displays six cells of content. In each
Ok so I have about six of these calendars on page, so thats around
My tab bar has ten tabs. Six of these are therefore shoved into the
In one of my Activities I do have up to six different AsyncTasks that
I wrote a heredoc three weeks ago that was working great, and until today
I have some functions that deal with data provided in array format. These functions
These ribbon in stackoverflow and uservoice.com looks nice. is there any javascript library/jquery plugin

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.