Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created April 26, 2017 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/d88d3650086dd6cb2c832c69b9ac50f2 to your computer and use it in GitHub Desktop.
Save deque-blog/d88d3650086dd6cb2c832c69b9ac50f2 to your computer and use it in GitHub Desktop.
template<typename Value>
struct Weighted
{
Value m_value;
double m_weight;
};
template<typename Value>
Weighted<Value> weighted(Value gen, double weight)
{
return Weighted<Value>{gen, weight};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment