$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Choosing a variable size
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2010-04-12 16:25:16
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