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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:01:52+00:00 2026-05-15T23:01:52+00:00

I can not get ‘operator <‘ to compile for a weak_ptr using VS10. Am

  • 0

I can not get ‘operator <‘ to compile for a weak_ptr using VS10. Am I missing an #include or #using?

Even the the code sample in the documentation does not work for me.
http://msdn.microsoft.com/en-us/library/bb982759.aspx

// temp.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

// std_tr1__memory__operator_lt.cpp
// compile with: /EHsc
#include <memory>
#include <iostream>

int main()
{
    std::shared_ptr<int> sp0(new int(0));
    std::shared_ptr<int> sp1(new int(0));

    std::cout << "sp0 < sp0 == " << std::boolalpha
        << (sp0 < sp0) << std::endl;
    std::cout << "sp0 < sp1 == " << std::boolalpha
        << (sp0 < sp1) << std::endl;
    std::cout << "sp1 < sp0 == " << std::boolalpha
        << (sp1 < sp0) << std::endl;
    std::cout << std::endl;

    std::weak_ptr<int> wp0(sp0);
    std::weak_ptr<int> wp1(sp1);

    std::cout << "wp0 < wp0 == " << std::boolalpha
        << (wp0 < wp0) << std::endl;
    std::cout << "wp0 < wp1 == " << std::boolalpha
        << (wp0 < wp1) << std::endl;
    std::cout << "wp1 < wp0 == " << std::boolalpha
        << (wp1 < wp0) << std::endl;
}
  • 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-15T23:01:52+00:00Added an answer on May 15, 2026 at 11:01 pm

    It turns out that there is no uncommented ‘bool operator<(const weak_ptr&, const weak_ptr&) in the header file. So contratry to the documentation, this is unsupported.

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

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is not pretty but it works: rm -R $(ls… May 16, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer Yes. Override the base1 and base2 methods in Derived to… May 16, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer No, you can't. Unfortunately, UIEvent doesn't expose any public way… May 16, 2026 at 12:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I can not get to make this comparison in this simple code error ..
I can not get the ContextMenuResource to return the correct information that I am
I can not get the difference between these sentences! would you please write some
I can not get logs from some customers, can I use Google Urchin in
I simply can not get Visual Studio 2005 to find the System.Configuration.ConfigurationManager class. Here
one thing i can not get straight is the ability to add html without
I am quite new to HTTPS and can not get my head around it.
In silverlight, I can not get INotifyPropertyChanged to work like I want it to
I can run example.exe from Terminal( mono example.exe).And I can not do this through
I am using MVVM architecture to develop a WPF application... So far everything has

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.