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

The Archive Base Latest Questions

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

Most (but I only actually know a small number so lets not get picky

  • 0

Most (but I only actually know a small number so lets not get picky on that point) high level languages support multiple different assignment operators.

a += 5;  // increment a and assign result beack to a.

But none (that I have looked at (again a small number)) seem to support the &&= operator.
The reason I ask I recently saw this:

// simplified.
bool x = false;


x = x && testA(); // perform test A/B/C/D stop on first failure.
x = x && testB();
x = x && testC();
x = x && testD();

And I was wondering why we could not use:

x &&= testA(); // perform test A/B/C/D stop on first failure.
x &&= testB();
x &&= testC();
x &&= testD();

The reason being that &&= is not supported in C/C++ which made we think why.

Is there a logical (no pun intended) reason why the language supports all the other major operators with an assignment form but not the &&= or ||=

I have a vague recollection for an argument against these, but google and SO searches are hard when your search term is ‘&&=’ and as a result I found nothing.

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

    && and || are special in the sense that they are, in most languages, the only constructions that provide short circuiting evaluation so it kind of makes sense for them to be treated differently from the normal, non short-circuiting, operators when it comes to the abbreviated forms. The easiest way to avoid the confusion of &&= short-circuiting or not is not including it in the first place.

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

Sidebar

Related Questions

this c# code is probably not the most efficient but gets what I want
Disclaimer This is not strictly a programming question, but most programmers soon or later
I know that Singleton pattern is bad because it uses global state. But in
I'm working on a website that uses not just frames, but frames within frames
I know this is a rookie question but whats actually happening with a progress
This is not a homework question, but rather my intention to know if this
Most websites use - (like Stack Overflow) but most PHP frameworks generate + encoded
My website sends out html emails but most of my recipients are receiving them
I've found many definitions of the 'var' statement but most of them are incomplete
I've just begun using LINQPad and so far I like it but most tutorials

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.