The argument of the ! operator and the first argument of the ternary operator are both implicitly converted to bool, so !! and ?: are IMO silly redundant decorations of the cast. I vote for
b = (t != 0);
No implicit conversions.
More Related Contents:
- Questions regarding constructors
- How does the Import Library work? Details?
- Unresolved external symbol in object files
- String literal matches bool overload instead of std::string
- LPCSTR, LPCTSTR and LPTSTR
- placement new and delete
- C++ : why bool is 8 bits long?
- Reference a temporary in msvc
- How to get screenshot of a window as bitmap object in C++?
- How do compilers treat variable length arrays
- std::to_string – more than instance of overloaded function matches the argument list
- Why the sizeof(bool) is not defined to be one, by the Standard itself?
- what does __declspec(dllimport) really mean?
- “newly” installed visual studio returns 408 errors on blank program of type ‘cannot open source file “errno.h” ‘
- Visual Studio 2010’s strange “warning LNK4042”
- How to use _CRT_SECURE_NO_WARNINGS
- Converting bool to text in C++
- What is the purpose of the _chkstk() function?
- VC++ fatal error LNK1168: cannot open filename.exe for writing
- How do I convert from LPCTSTR to std::string?
- Using bind1st for a method that takes argument by reference
- Why does the compiler choose bool over string for implicit typecast of L””?
- How to increment an iterator by 2?
- How can I see the output of the Visual C++ preprocessor? [duplicate]
- C++ bool returns 0 1 instead of true false
- How to erase & delete pointers to objects stored in a vector?
- Measuring exception handling overhead in C++
- Explicit Return Type of Lambda
- __attribute__((format(printf, 1, 2))) for MSVC?
- How do I find the current directory?