Greetings,
I just had this idea today and it makes a lot of sense to add to the ISO C++ Standards.
1) Classes and structures are used for what exactly?
- Databases;
- XML I/O;
- Binary XML I/O;
- UI Widgets;
- Neural Network Abstraction & Representation;
- ...
2) What I am suggesting is to add a series of axioms that will implicitly transform simple namespaced structures into fully functional code, i.e.:
namespace data
{
struct Address
{
std::string country, state, city, street, zip_code;
unsigned int number;
};
struct Employee
{
std::string first_name, surname;
unsigned int age;
double salary;
std::string position;
Address address;
}
3) You create the axioms:
template <typename T>
axiom xml
{
[...] somehow reads all member variables and converts them into Database Data, XML, Binary XML, UI Widgets, ... };
4) You start using it:
xml<Data::Employee> employee1(/* Creates Connection to XML Server */);
employee1 >> ...; // Writes to XML Server
Or:
ui<Data::Employee> employee2; // Creates widget
employee2 << ...; // Reads from widget
|
||||||||
Le message ci-dessus,
ainsi que les documents l'accompagnant, sont destinés
uniquement aux personnes identifiées et peuvent contenir
des informations privilégiées, confidentielles ou ne
pouvant être divulguées. Si vous avez reçu ce message par
erreur, veuillez le détruire. This communication (and/or the attachments) is intended for named recipients only and may contain privileged or confidential information which is not to be disclosed. If you received this communication by mistake please destroy all copies. |