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

  • Home
  • SEARCH
  • 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 6639985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:37:12+00:00 2026-05-25T23:37:12+00:00

I am getting errors about the template arguments not being valid and it is

  • 0

I am getting errors about the template arguments not being valid and it is not seeing that I declared my queue variables as global.., i tried putting them inside the function (but thats not what I want because i want to deque from main) and does not work either.. Here are my errors and code

program.cpp: In function ‘int main(int, char**)’:
program.cpp:62:24: error: argument of type ‘bool (std::queue<std::basic_string<char> >::)()const’ does not match ‘bool’
program.cpp:62:24: error: in argument to unary !
program.cpp:68:23: error: argument of type ‘bool (std::queue<std::basic_string<char> >::)()const’ does not match ‘bool’
program.cpp:68:23: error: in argument to unary !






#define _XOPEN_SOURCE 500
#include <ftw.h>
#include <stdio.h>
#include <string>
#include <queue>
#include <iostream>

#define SIZE 100

using namespace std;

  queue<string> bfFilesQueue;
  queue<string> bfDirsQueue;

static int display_info(const char *fpath, const struct stat *sb,
             int tflag, struct FTW *ftwbuf)
{

    //Check the type of Flag (i.e File or Directory)
    switch(tflag)
    {
        case FTW_D: 
        case FTW_F: 
                    bfFilesQueue.push(fpath);
                    break;

        case FTW_DP: 
                     bfDirsQueue.push(fpath);
                     break;
    }
    return 0; /* Continue */
}

int main(int argc, char *argv[])
{

    if (argc != 2) {
        fprintf(stderr, "Usage: %s directory_name\n", argv[0]);
        return 1; 
    }  

    int flags = FTW_DEPTH | FTW_MOUNT | FTW_PHYS;


    if (nftw(argv[1], display_info, 20, 1) == -1)
    {
        perror("nftw");
        return 255;
    }
   printf("***************************\n");

   while(!bfFilesQueue.empty)
   {
       cout << bfFilesQueue.front() << " ";
        bfFilesQueue.pop();
   }

   while(!bfDirsQueue.empty)
   {
       cout << bfDirsQueue.front() << " ";
        bfDirsQueue.pop();
   }


    return 0;
}
  • 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-25T23:37:13+00:00Added an answer on May 25, 2026 at 11:37 pm

    Your while statements are attempting to check the function std::queue::empty() itself, and not the result of a call to the function. The type that appears in your error message is the type of the function.

    As overcoder’s comment says, adding parentheses will fix the code.

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

Sidebar

Related Questions

I'm getting errors and warnings that seem to indicate that 4th edition examples are
Im a getting errors from some code developed in Java that want to use
I keep getting errors that my functions have been defined multiple times. Of course
In testing an app, I keep getting errors that occur sporadically on only one
I'm getting a bunch of errors about missing references. Anyone know why? Viewing the
I am getting an error about the assembly C:\Ora10g\bin\Zip.exe. The trouble is this solution
I am doing a recursive program and I am getting an error about conflicting
i am getting this error does some one knows about it??? 2009-07-08 18:42:36.778 FlashCards[1297:20b]
I'm probably getting mad about it and there must be some trivial error in
Just start to learning Cocos2d and getting errors in Xcode 4.3.3 (4E3002). Problem in

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.