@seeplus, thank you. Do i need to have C++17 enabled to run it?
I run it using the following compiler, but got errors. I also tried by clicking "Edit & Run" next to your reply but got errors.
g++ (Ubuntu 8.3.0-6ubuntu1) 8.3.0
To run it in ubuntu (version 19.04) with above compiler version, what changes I need to make? Or would you suggest me which compiler i have to install in ubuntu to run it successfully?