$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users]  Using different variables based on template type
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2009-06-02 01:41:27
I have a couple of functions that provide the same functionality for 
different types.  I'd like to combine them to reduce code duplication.  
An example of two functions is listed below.
std::map<std::string, uint16>   m_Uint16;
std::map<std::string, uint32>   m_Uint32;
void putUint16(std::string const& variableName, uint16 const& value) {
    m_Uint16[variableName] = value;
}
void putUint32(std::string const& variableName, uint32 const& value) {
    m_Uint32[variableName] = value;
}
The functions can't be combined into a template since they are the 
interface for the programmer.  Is there a boost library that would let 
me call a template or common function that would use a different 
variable based on the variable type?
Ryan