Need help just writing a fragment of code in C++, the code is incomplete I just need help writing the constructor. I have highlighted the
Need help just writing a fragment of code in C++, the code is incomplete I just need help writing the constructor. I have highlighted the area that needs the code added in
Write a public default constructor for signal_handler_op as follows:
- construct the type_ member with op_type::default_, and,
- constructs sa_handler_ with the value of DEFAULT
Code Below:
class signal_handler_op {
private:
enum class op_type { error, default_, ignore, traditional, sigaction };
public:
using traditional_op_type = void(*)(int); using sigaction_op_type = void(*)(int, siginfo_t * , void *);
private:
traditional_op_type static const ERROR;
traditional_op_type static const IGNORE; traditional_op_type static const DEFAULT;
op_type type_;
union { traditional_op_type sa_handler_; sigaction_op_type sa_sigaction_; };
public:
/* FIX/FINISH THE CODE BELOW */
signal_handler_op(): default; //default constructor
type_ op_type::default_
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started