Relacement for removed bind1st in c++17

  • A+
Category:Languages

I have this usage for bind1st, i upgraded my project to c++17 and as i read bind1st was removed.

With what i can replace bind1st in the following statement? Lambda?

DBManager::Instance().FuncQuery(std::bind1st(std::mem_fn(&CGuild::LoadGuildData), this), "SELECT master, level, exp, name, skill_point, skill, sp, ladder_point, win, draw, loss, gold FROM guild WHERE id = %u", m_data.guild_id); 

 


Just use std::bind:

std::bind(std::mem_fn(&CGuild::LoadGuildData), this, std::placeholders::_1) 

And you can remove the superfluous std::mem_fn too:

std::bind(&CGuild::LoadGuildData, this, std::placeholders::_1) 

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: