A SocketOption? would wrap the arguments to possible get/setsockopt calls.
e.g.
template <int LevelValue?, int OptionValue?, bool CanGet?, bool CanSet?, typename ValueType?> struct socket_option { socket_option() {} socket_option(const ValueType?& ov) : value(ov) {}
BOOST_STATIC_CONSTANT(int, level = LevelValue?); BOOST_STATIC_CONSTANT(int, option = OptionValue?); BOOST_STATIC_CONSTANT(bool, can_get = CanGet?); BOOST_STATIC_CONSTANT(bool, can_set = CanSet?); ValueType? value; static int size() {return sizeof(ValueType?); } };
typedef socket_option<SOL_SOCKET, SO_ERROR, true, false, bool> socket_option_error;