Introduction
After long day's discussion, bool was made as built-in type. Before it lot of other proposals came for bool. There were following proposals.
Proposal 1: bool can be implemented by typedef
Code:
typedef int bool ;
Code:
void Fun( int ); void Fun( bool);
dropped. I don't think so it gives any problem in C. Only problem will be in C++. Let's waiting for you guys comments.
Proposal 2: bool can be implemented by enumeration (enum)
This proposal was based on enum like
Code:
enum bool
{
false,
true
};
Code:
int i = 4;
if( i )
{
//statement
}
Proposal 3: Bool can be implemented as class
Code:
class bool
{
public:
operator int () {;}
private:
int bVal;
};
1. Since bool is class so whenever you will take a variable of bool two functions one is Constructor and other is destructor. So it's pain, costly.
2. One thing more whenever you want to use you have include this files to your working codes/projects/program etc. From my point of view it's not a problem because by any way you are including a lot of files or this bool can be declared already existing library only.
3. This is the last drawback of bool using as class is that the conversion operator might interfere with user-defined conversion operators that are defined in other classes. This is more important drawback not to use bool as class.
So seeing above drawbacks, standard committee decided to make bool as built-in type. So bool as built-in type gives us better readability, good performance, type distinctness, portability etc.

