Ошибка при инициализации с помощью std::tie
sf::Texture const& texture();
std::map<EnemyAction, unsigned> amountFrame;
std::map<EnemyAction, sf::IntRect> enemyRect;
float damage;
std::tie(texture, enemyRect, amountFrame, damage) = (enemy.type == "small_zombie") ?
std::make_tuple(m_gameTexture.GetEnemyTexture(), smallEnemyRect, smallEnemyFrame, SMALL_ZOMBIE_DAMAGE)
: std::make_tuple(m_gameTexture.GetBigEnemyTexture(), bigEnemyRect, bigEnemyFrame, BIG_ZOMBIE_DAMAGE);
Ошибка
note: см. ссылку на создание экземпляров функции шаблон при компиляции
"std::tuple<const sf::Texture &(__cdecl &)(void),std::map<EnemyAction,sf::IntRect,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>> &,std::map<_Kty,unsigned int,std::less<_Kty>,std::allocator<std::pair<const _Kty,unsigned int>>> &,float &> &std::tuple<const sf::Texture &(__cdecl &)(void),std::map<_Kty,_Ty,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>> &,std::map<_Kty,unsigned int,std::less<_Kty>,std::allocator<std::pair<const _Kty,unsigned int>>> &,float &>::operator =<sf::Texture,std::map<_Kty,_Ty,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>,std::map<_Kty,unsigned int,std::less<_Kty>,std::allocator<std::pair<const _Kty,unsigned int>>>,float>(std::tuple<sf::Texture,std::map<_Kty,_Ty,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>,std::map<_Kty,unsigned int,std::less<_Kty>,std::allocator<std::pair<const _Kty,unsigned int>>>,float> &&)"
1> with
1> [
1> _Kty=EnemyAction,
1> _Ty=sf::IntRect
1> ]
1> Game.cpp(62): note: см. ссылку на создание экземпляров функции шаблон при компиляции "std::tuple<const sf::Texture &(__cdecl &)(void),std::map<EnemyAction,sf::IntRect,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>> &,std::map<_Kty,unsigned int,std::less<_Kty>,std::allocator<std::pair<const _Kty,unsigned int>>> &,float &> &std::tuple<const sf::Texture &(__cdecl &)(void),std::map<_Kty,_Ty,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>> &,std::map<_Kty,unsigned int,std::less<_Kty>,std::allocator<std::pair<const _Kty,unsigned int>>> &,float &>::operator =<sf::Texture,std::map<_Kty,_Ty,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>,std::map<_Kty,unsigned int,std::less<_Kty>,std::allocator<std::pair<const _Kty,unsigned int>>>,float>(std::tuple<sf::Texture,std::map<_Kty,_Ty,std::less<_Kty>,std::allocator<std::pair<const _Kty,_Ty>>>,std::map<_Kty,unsigned int,std::less<_Kty>,std::allocator<std::pair<const _Kty,unsigned int>>>,float> &&)"
1> with
1> [
1> _Kty=EnemyAction,
1> _Ty=sf::IntRect
1> ]
sf::Texture const& texture();
это объявление функции, а не переменной.
Кофе для программистов: как напиток влияет на продуктивность кодеров?
Рекламные вывески: как привлечь внимание и увеличить продажи
Стратегії та тренди в SMM - Технології, що формують майбутнє сьогодні
Выделенный сервер, что это, для чего нужен и какие характеристики важны?
Современные решения для бизнеса: как облачные и виртуальные технологии меняют рынок
В ComboBoxDelegatecpp получаю переменную key:
Прошу сразу не кидаться тапками ибо не знаю, подходит ли данный вопрос по тематике этого сайтаЕсли вопрос не подходит
Я провел несколько экспериментов, но объяснить почему это так работает я не смог