Jump to content

Recommended Posts

you'd have a look at auto_ptr or better unique_ptr (which you'd use instead of auto_ptr)

The first one executes an Async-Query. As stated in db.h it does not return a value at all. So it makes absolutely no sense to store it's result anywhere.

The second one is meant to be used when you want to store the results inside a variable. It's a direct query which means it'll be executed and the rest of the code will only continue when the query has finished and returned a value. You can later use it to e. g. check if the query was successful or not. In this case it's best to wrap it inside a unique_ptr (or in your case you mentioned auto_ptr which I do not recommend to use).

So, if you do not need to check the queries results (as mysql errors will be displayed anyway) and you do not need a returned value for proceeding, you can just use a Async Query. If you do need the results, then wrap it inside a auto_ptr and use a DirectQuery.

  • Love 3

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

Link to comment
https://metin2.dev/topic/10917-c-difference-dbmanager/#findComment-63996
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.