[Quantity-devel] replace function in VariableVector
Brought to you by:
berndspeiser
|
From: Kai L. <km...@us...> - 2004-07-03 17:17:35
|
Bernd,
I propose the following function in the
VariableVector class:
//! replace the element at position index
template<template<class, class> class Q1, class GT1, class Head1,
class Tail1, class DU1, class U1, class DT1>
void replace (const int index, const Q1<Quantity<GT1,
Typelist<Head1, Tail1>, DU1, DT1>, U1> &new_quantity)
{
if (index >=3D 0 && index < length ())
{
values[index] =3D
Unit::Reverse(CheckAgainstAllUnits<typename Q1<Quantity<GT1,
Typelist<Head1, Tail1>, DU1, DT1>, U1>::Unit,
typename TL::Append<Typelist<Head, Tail>,
NonPrefixable<typename Q1<Quantity<GT1,
Typelist<Head1, Tail1>, DU1, DT1>, U1>::Type,
GenericUnit, DT>
>::Result >::RET::Standard
(new_quantity.raw_value()));
}
else
{throw QuantityVectorOutOfBounds();}
}
Kai
--=20
http://echempp.sourceforge.net
Kai Ludwig
Institut f=FCr Organische Chemie
Auf der Morgenstelle 18
72076 T=FCbingen
Tel.: 07071/29-73049
Mail: kai...@un...
|