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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:25:43+00:00 2026-05-26T06:25:43+00:00

I think I know why I am getting this error, but I’m not sure

  • 0

I think I know why I am getting this error, but I’m not sure how to correct it..

template <typename T>
std::ostream& operator<<(std::ostream& os, const btree<T>& tree) {

  queue < btree<T> > q;
  class list <node<T>*>::iterator itr = bt.neighbours.begin();
    for (; itr != bt.neighbours.end(); itr++) {
      os << (*itr)->getItem() << " ";
      // add all the btree's connected to this node to the queue
      q.push((*itr)->left());

    }

}

template <typename T> 
class node {
  public:
    btree <T> * left() { return l; }
  private:
    btree <T> * l;
}

the error message I’m getting is:

test.cpp:18:   instantiated from here
btree.tem:125: error: invalid conversion from 'btree<char>*' to 'unsigned int'
btree.tem:125: error:   initializing argument 1 of 'btree<T>::btree(size_t) [with T = char]'

it seems to me, that because I’m pushing a pointer to an object into the queue, where the queue only accepts the object it is causing this error. I’m lost in how to fix this problem, any help would be most appreciated!!

Thanks in advance =]

  • 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-26T06:25:44+00:00Added an answer on May 26, 2026 at 6:25 am

    Change the queue::push statement for pushing an object:

    q.push(*((*itr)->left()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think this code and error is self-explanatory, but I don't know why? Environment:
This was working just fine, not sure what broke it, but now I'm getting
I am getting to know boost::variant. I think this example should work. #include <boost/fusion/sequence.hpp>
I think know how to do this in C# but I'm having syntax trouble
I think I know how to handle this case, but I just want to
I am updating this post with what I think I now know about getting
Im trying to display this listview, but I keep getting a: 07-17 21:14:22.233: ERROR/AndroidRuntime(349):
I'm getting an error on my partial method and I'm not sure why. I
I think I know how to create custom encrypted RSA keys, but how can
I think I know the answer, but I would like to bounce around some

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.