xtd 0.2.0
Loading...
Searching...
No Matches
static_object.cpp

Shows how to use static_object_ keyword.

#include <xtd/console>
#include <xtd/static>
using namespace xtd;
namespace static_object_example {
class program static_object_ {
public:
static string to_string() {return "program";}
};
}
auto main() -> int {
// uncomment next line cause build error with call implicitly-deleted default constructor.
//auto program = static_object_example::program {};
console::write_line(static_object_example::program::to_string());
}
// This code produces the following output :
//
// program
#define static_object_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:53
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10