I have a class with an object as a member which doesn\'t have a default constructor. I\'d like to initialize this member in the constructor, but it seems that in C++ I can\'
I think your solution is the correct way to do things.
You can also postpone the creation of the object by making is pointer (however it changes the code and data type):
std::auto_ptr _sock;
And then in body:
_sock.reset(new udp::soket(_io_service, ep));
But I think that your "workaround" is rather correct solution then workaround.