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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:11:00+00:00 2026-06-17T10:11:00+00:00

The following code compiles fine when using STLPort: std::vector<Engine::Screen::IOverlay*> Overlays; auto TestOverlay=new Engine::Screen::Overlay(); Overlays.push_back(TestOverlay);

  • 0

The following code compiles fine when using STLPort:

std::vector<Engine::Screen::IOverlay*> Overlays;
auto TestOverlay=new Engine::Screen::Overlay();
Overlays.push_back(TestOverlay);

However when compiling with libstdc++ it’s trying to use move constructor for some reason:

error : cannot bind 'Engine::Screen::IOverlay*' lvalue to 'Engine::Screen::IOverlay*&&' ...\android-ndk-r8\sources\cxx-stl\gnu-libstdc++\include\bits\move.h

This is a very basic example but this issue occurs through out the application for all local pointers when using push_back.

Error occurs in move.h:

template<typename _Tp>
inline typename std::remove_reference<_Tp>::type&&
move(_Tp&& __t)
{ return __t; }

Example 2 (Another basic test I wrote:)

class TestClass {};
auto TestInstance=new TestClass;
std::vector<TestClass*> TestVector;
TestVector.push_back(TestInstance);

I compiled with ndk r8: -std=c++11 -D__STDC_INT64__

  • 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-17T10:11:02+00:00Added an answer on June 17, 2026 at 10:11 am

    It seems there are two bugs in the compiler. First it incorrectly callspush_back(T&&) which then attempts to move the object, which is implemented incorrecty:

    template<typename _Tp>
    inline typename std::remove_reference<_Tp>::type&&
    move(_Tp&& __t)
    { return __t; }
    

    It should be implemented as:

    template<class _Tp> 
    typename remove_reference<_Tp>::type&&
    move(_Tp&& __t) noexcept //noexcept should be here!
    {
      return static_cast<typename remove_reference<_Tp>::type&&>(__t);
    }
    

    which means your compiler is showing up two bugs in this context:

    • incorrect overload resolution, as it calls push_back(T&&).
    • incorrect implementation of std::move

    which version of what compiler are you using?

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

Sidebar

Related Questions

I am new to OpenMP. I have the following code which compiles fine using
I came across the following code that compiles fine (using Visual Studio 2005): SomeObject
The following code compiles fine using MSVC 2008. When you build GCC climbs a
I am unclear about the following. First, this code compiles fine: #include <vector> typedef
In Microsoft Oslo SDK CTP 2008 (using Intellipad) the following code compiles fine: module
Visual Studio 2008 I am using the following source code that compiles ok using
I'm using MinGw on Windows 7. The following simple program compiles fine, but the
The following code compiles just fine, overwriting the values in v2 with those from
The following code compiles fine on majority of compilers (include Microsoft Visual Studio's -
The following code snippet compiles just fine on Mac OS X with gcc, but

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.