On Sunday, 29 September 2019 at 13:24:40 UTC, Adam D. Ruppe wrote:
On Sunday, 29 September 2019 at 04:37:43 UTC, Murilo wrote:
Thanks. Now, I would like to know if I could just use it like this instead:

What happens if an exception is thrown in the middle of your function? It shouldn't really matter (at least not with the newer versions) since it will automatically exit the audio thread when the main thread exits, but still there's definitely no benefit to writing it without the scope guard.

I'm very minimalistic, I hate unnecessary complexity, I believe that simple is better than complex so I always try to use the least syntax and lines of code when I'm making a program. That is why I don't like the scope guard. Could I simply add the lines `audio.stop(); audio.join();` to the very end of main()?

Reply via email to