
12 Apr
2010
12 Apr
'10
8:25 p.m.
John Dlugosz wrote:
Given a template function that has two incoming integral types to work with, I want to declare some variables for intermediate use. How do I easily make a typedef for the larger of the two?
Something like this will do (untested!): typedef typename boost::mpl::if_c< sizeof( T1 ) >= sizeof( T2 ), T1, T2 >::type larger_type; HTH, Gevorg