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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:20:56+00:00 2026-06-12T18:20:56+00:00

I am trying to make a list of iNUIsensor objects, in c++. I have

  • 0

I am trying to make a list of iNUIsensor objects, in c++.

I have tried using this:

std::list<INuiSensor*> nuiList;    
...
nuiList.push_front(&nui);

Upon compiling I get this error:

error C2664: 'void std::list<_Ty>::push_front(_Ty &&)' : cannot convert parameter 1 from     'INuiSensor **' to 'INuiSensor *&&'

How can I fix this problem?

Edit:
type of nui:

INuiSensor * nui;
  • 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-12T18:20:57+00:00Added an answer on June 12, 2026 at 6:20 pm

    You’re pushing a pointer to a pointer to nui while the list is expecting a pointer to nui:

    std::list<INuiSensor*> nuiList;    
    ...
    nuiList.push_front(nui); // <--- note the lack of &
    

    The fact is that nui is a pointer to begin with, and the operator & takes the address of the given object, so:

    &nui
    

    Is readed as: take the address of the object named nui. So, if the object is a pointer to niu the address of a pointer is a pointer to a pointer.


    This isn’t asked but I think is worth to say: Could be a good idea to avoid storing object pointers into containers and change the store type by object instances:

    std::list <INuiSensor*> VS std::list <INuiSensor>
    

    When you’re using pointers you must take care of the allocation and deallocation of the objects, if the lists are global you’ll need a public Close method to deallocate all the memory managed by the pointers stored in the lists, if the list is owned by some object, you need to do the same process into the object destructor.

    But, if you’re storing object instances, the list destructor deallocates all the objects stored when it’s lifetime ends, the code is cleaner and easier to maintain.

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

Sidebar

Related Questions

I am trying to make a list box where I have complete control over
I'm trying to make a list containing different objects. List<Object> list = new ArrayList<Object>();
I was trying to make an array-based linear list, then I compiled this: char
I'm trying to make a list containing names. This list should be modifiable (add,
I am trying to make a list navigable using the up/down arrow keys -
I have been trying to make a list box report parameter with multiple choice
I'm trying to make a list item expandable. Basically, I want to have a
Using Entity Framework CTP 5 I am trying to make a list of foreign
I'm have quite a problem while trying to make a list (for the admin
Iam trying to make my Activity List more effective. I have an Activity List

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.