Giter Club home page Giter Club logo

operator_alternative's Introduction

Before to start

When I see this, I was very shocked because I've never see this before and I never thought of it. You can look at this repo for more information about operator alternatives in CPP to enlarge your mind (:

Code examples

So you are still using && ๐Ÿค” You are just crazy, look at this alternative.

&& to 'and'

And yeah, I am using <% %> for { } like EJS

int main( )
<%
   auto username = "swenenzy";
   auto year = 2021;
   // Look at this i'm using 'and' instead of && very strange right?
   if ( username == "swenenzy" and year == 2021 ) <%
	   printf( "both sides are equal" );
   %>
%>

image_1

|| to 'or';

Why not?

int main( )
<%
   auto username = "swenenzy";
   auto year = 2021;
   if ( username == "swenenzy" or year == 2023 ) <%
	   printf( "one out of both correct\n" );
   %>
%>

image_2

How about includes?

You can use includes like this syntax.

%:include <iostream>

Reference table

Primary Alternative
&& and
&= and_eq
& bitand
| bitor
~ compl
! not
!= not_eq
|| or
|= or_eq
^ xor
^= xor_eq
{ <%
} %>
[ <:
] :>
# %:
## %:%:

CPPReference has more detailed documentation, I'm writing this repo because I haven't seen it on github before.

You can give me suggestions with PR or ISSUES for improving this repo.

Check out CPPReference!

This documentation is all tested on C+14 to C+21.

Peace out ๐Ÿ––

operator_alternative's People

Contributors

swenenzy avatar vexdy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.