ошибка при инициализации с помощью std::tie

337
23 декабря 2016, 14:28

Ошибка при инициализации с помощью 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>          ]
Answer 1

sf::Texture const& texture(); это объявление функции, а не переменной.

READ ALSO
Как отправить переменную из делегата в другой класс?

Как отправить переменную из делегата в другой класс?

В ComboBoxDelegatecpp получаю переменную key:

344
Как управлять камерой Onvif?

Как управлять камерой Onvif?

Прошу сразу не кидаться тапками ибо не знаю, подходит ли данный вопрос по тематике этого сайтаЕсли вопрос не подходит

329
sizeof для символа кириллицы

sizeof для символа кириллицы

Я провел несколько экспериментов, но объяснить почему это так работает я не смог

479
Ошибка компиляции LNK 2005

Ошибка компиляции LNK 2005

Список ошибок:

326