SANJU V. S SANJU V. S - 1 year ago 100
C++ Question

Function return different types C++

Which is the best method to use when we need to return different types in a C++ function. Can anybody suggest the best among template, boost variant, union?

Answer Source

In your situation i prefer boost::variant. You can go through the official documentation. Or you can see example illustrated in this blog.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download