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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:39:47+00:00 2026-05-30T11:39:47+00:00

I needed to use the std::is_assignable type traits, which happens not to be available

  • 0

I needed to use the std::is_assignable type traits, which happens not to be available in the oldest compiler version that I want to support. Since I had to implement this myself (okay, I admit it, there was some interwebs peeking), I now wonder if this is a bug in my implementation or a general problem of std::is_assignable.

First of all, this is my test struct:

struct Bar {
  bool const cb; // this should kill the default assignment operator
  int i;
};

and here is my stdreplace::is_assignable

template <typename T> struct is_assignable : private std::__sfinae_types {
  private:
    template <typename T1> 
      static decltype(std::declval<T1>() = std::declval<T1>(),__one()) test(int);
    template <typename T1> 
      static __two test(...);
  public:
    static bool const value = sizeof(test<T>(0)) == sizeof(__one);
};

However, it tells me, Bar is assignable:

int: 1
Bar: 1
int[2]: 0

Where is the problem?

  • 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-30T11:39:48+00:00Added an answer on May 30, 2026 at 11:39 am

    Your compiler probably does not correctly define the assignment operator as deleted. In c++03 code with respect to implicitly declared special member functions, such an assignment within an unevaluated operand was fine even if the assignment would be illformed if it occurs in an evaluated operand. The reason for that is because the asignment operator would never be implicitly defined but only implicitly declared thus never rising an error.

    Since that changed in c++11 and your assignment operator should be deleted automatically it appears to me that your compiler is at fault.

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

Sidebar

Related Questions

I am attemping to use NetUseAdd to add a share that is needed by
I have a div that I use to display alerts when needed. If I
I was advised a while ago that is was common place to use std::vector
Related: what can I use as std::map keys? I needed to create a mapping
I observed that in my program I needed to make several classes use the
I needed to use in my old Git similar settings to the following to
This weekend I was working on a project and I needed to use a
I needed to find and use the coordinates of the intersection of a cubic
I use a large (millions) entries hashmap to cache values needed by an algorithm,
I use an external API where a domain/key-pair is needed, and the domain-name doesn't

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.