// Example 4-2: Declarations that seem like expressions.
#include <iostream>
#include <ostream>

class cls {
public:
  cls() { std::cout << "cls::cls()\n"; }
  cls(int x) { std::cout << "cls::cls(" << x << ")\n"; }
};

int x;
int* y = &x;

int main()
{
  // The following are unambiguously expressions:
  // constructing instances of cls.
  cls(int(x));
  cls(*static_cast<int*>(y));

  // Without the redundant casts, though, they would look
  // like declarations, not expressions.
  cls(x);   // declares a variable x
  cls(*y);  // declares a pointer y
}
