C++ Logo

std-proposals

Advanced search

Axiomed namespaced structures

From: Phil Bouchard <boost_at_[hidden]>
Date: Tue, 4 Jan 2022 15:19:03 -0500
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


So basically we need to create an mutliusage abstraction layer so that
structures are really defined only once. I still haven't decided the
best way to represent these axioms but I'll come up with something soon.
But basically the "axiom" will have the capability to scan implicitly
all member variables of a given class.


Regards,

-- 
Email Signature
Logo <https://www.fornux.com/>  
*Phil Bouchard*  facebook icon 
<https://www.linkedin.com/in/phil-bouchard-5723a910/>
CTO
T: (819) 328-4743
E: phil_at_[hidden]| www.fornux.com <http://www.fornux.com>
1188 rue Saint-Louis| Gatineau (Qc), J8T 2L8 Canada
Banner <https://goglobalawards.org/> 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.

Received on 2022-01-04 14:19:09