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

Shows how to use xtd::static class.

#include <xtd/console>
#include <xtd/static>
using namespace xtd;
namespace static_object2_example {
class program final : public 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_object2_example::program {};
console::write_line(static_object2_example::program::to_string());
}
// This code produces the following output :
//
// program
Represent a static object. A static class can't be instantiated (constructors are deleted).
Definition static.h:20
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10