Skip to content

Instantly share code, notes, and snippets.

@PkmX
Created June 5, 2013 05:55
Show Gist options
  • Save PkmX/5711872 to your computer and use it in GitHub Desktop.
Save PkmX/5711872 to your computer and use it in GitHub Desktop.
#include <vector>
#include <boost/strong_typedef.hpp>
BOOST_STRONG_TYPEDEF(std::vector<std::vector<int>>, bitmap)
BOOST_STRONG_TYPEDEF(std::vector<std::vector<int>>, heightmap)
bitmap load_dog_sprite()
{
return {};
}
heightmap get_level1_terrain()
{
return {};
}
void render(const heightmap&, const bitmap&)
{
}
int main()
{
// gcc: error: invalid initialization of reference of type ‘const heightmap&’ from expression of type ‘bitmap’
// clang: note: candidate function not viable: no known conversion from 'bitmap' to 'const heightmap' for 1st argument
render(load_dog_sprite(), get_level1_terrain());
// ok
render(get_level1_terrain(), load_dog_sprite());
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment