首页 > 其他分享 >and

and

时间:2024-05-08 12:44:37浏览次数:12  
标签: false eq 等价 assert static true

1. 简介

  一个运算符,表示 “逻辑与”, 等价于 && 运算符

 

2. 示例

int main()
{
    static_assert((false and false) == false);
    static_assert((false and true)  == false);
    static_assert((true  and false) == false);
    static_assert((true  and true)  == true);
}

 

3. 补充

  类似的关键字还有:

    i. and_eq        //  等价于 &=

    ii. bit_and  //  等价于 &

    iii. bit_or    //  等价于 |

    iv. compl        //  等价于 ~

    v. not      //  等价于 !

    vi. not_eq      //  等价于 !=

              vii. or             //  等价于 ||

    viii. or_eq      // 等价于 |=

    viiii. xor         // 等价于 ^

    x. xor_eq    // 等价于 ^=

  

标签:,false,eq,等价,assert,static,true
From: https://www.cnblogs.com/newbird2021/p/18179418

相关文章