Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

D operators that are not in C++

Tags:

c++

d

Are there any operators in D that are not in C++?

like image 409
Winter Avatar asked Apr 22 '10 16:04

Winter


People also ask

Which operator is not used in C?

C NOT Logical Operator is used to inverse the result of a boolean value or an expression. ! is the symbol used for NOT Logical Operator in C programming. C NOT Operator takes only one boolean value as operand and returns the result of NOT operation.

What are the 7 types of operators?

In Python, there are seven different types of operators: arithmetic operators, assignment operators, comparison operators, logical operators, identity operators, membership operators, and boolean operators.


2 Answers

Here is a list of some D tokens

/=
.
..
...
&
&=
&&
|
|=
||
-
-=
--
+
+=
++
<
<=
<<
<<=
<>
<>=
>
>=
>>=
>>>=
>>
>>>
!
!=
!<>
!<>=
!<
!<=
!>
!>=
(
)
[
]
{
}
?
,
;
:
$
=
==
*
*=
%
%=
^
^=
~
~=

Those for example:

<>
<>=
!<>
!<>=
!<
!<=
!>
!>=

are special operators to compare floating point variables. You can find the description of them here http://www.digitalmars.com/d/1.0/expression.html

There are also the

is 
!is
in
!in
typeof

operators.

like image 119
Maciej Hehl Avatar answered Sep 30 '22 01:09

Maciej Hehl


  • ^^ and ^^= for exponentiation
  • ~ and ~= for concatenation
  • >>> and >>>= for signed (or is it unsigned) bit shift
like image 34
BCS Avatar answered Sep 30 '22 01:09

BCS