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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:15:13+00:00 2026-06-04T16:15:13+00:00

I am compiling this code with g++ version 3.4.4 on windows:- #include <iostream> template<

  • 0

I am compiling this code with g++ version 3.4.4 on windows:-

#include <iostream>

template< int i >
class LOOP{
 public:
    static inline void EXEC(int* count){
        (*count)++;
            LOOP< i-1 >::EXEC(count);
   }
};

template<> class LOOP< 0 >{
  public:
    static inline void EXEC(int* count){
   (*count)++;
   }
};

 int main(int i){

int barely = 0;
LOOP< 1000 >::EXEC(&barely);
 }

It complains, incomplete type LOOP<500> used in nested name specifier and has a list of the previous instantiations before it, “instantiated from static void LOOP::EXEC(int *) with i – 1000” and so on.

When I change it to LOOP<100> it compiles fine though.

EDIT I am running this on cygwin if that affects the implementation limits.

  • 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-04T16:15:14+00:00Added an answer on June 4, 2026 at 4:15 pm

    You hit the implementation’s template depth limit. You can increase the limit by compiling with -ftemplate-depth=1005 (modern GCC) or -ftemplate-depth-1005 (older GCC).

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

Sidebar

Related Questions

Compiling this code with g++ 4.7.0 ( -Wall -Wextra -Werror -Wconversion -std=c++11 ): #include
I have this code in a single file : public class genIntro { public
I have this C++ file: #include <iostream> int main(int argc, char *argv[]) { std::cout
Consider the following C program, 'pause.c': void main() { pause(); } Compiling this on
I get an undefined reference to 'typeof'-error compiling and linking this: #include <stdio.h> #include
Recently I tried compiling program something like this with GCC: int f(int i){ if(i<0){
I want to wirte a function with variable arguments in this way: static void
I'm compiling using Code::Blocks on Windows 7 using the MinGW compiler (which I can
#include stdafx.h #include <windows.h> #include <winsock.h> #include <stdio.h> int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR IpCmdLine,int
I'm having trouble compiling some code against ocilib (libocilib.a) on version 3.9.0: $ ls

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.