#ifndef CONTROLLING_UNIONS_H
#define CONTROLLING_UNIONS_H
// Controlled Unions
// Reference: The C++ Programming Language (4th Edition), Bjarne Stroustrup
#include <string>
class Entry {
public:
Entry(){};
Entry(std::string name, int num)
: _name{name}, _type{Tag::number}, _number{num} {};
Entry(std::string name, std::string str) : _name{name}, _type{Tag::text} {
new (&_text) std::string{str}; // NOLINT
};
~Entry(); // non-default destructor
Entry(const Entry&); // copy constructor
Entry& operator=(const Entry&); // copy assignment constructor
This file has been truncated. show original