Skip to content
Snippets Groups Projects
Commit 0bbc2417 authored by Philip Mueller's avatar Philip Mueller
Browse files

The dimensional array now supports an assign function.

This function allows to set all elements of the array to a single value.
parent 69bb0f3a
Branches
No related tags found
No related merge requests found
...@@ -407,6 +407,32 @@ public: ...@@ -407,6 +407,32 @@ public:
}; //End: operator[] (const) }; //End: operator[] (const)
/**
* \brief This function sets all values of *this to v.
*
* This function bypasses v to the assign function of the underlying container.
* There is no check performed on v.
* The only requirement is that *this is valid.
* All components of *this will afterwards be equal v.
*
* \param v The value we use for assigning.
*/
void
assign(
const Numeric_t v)
{
if(this->hasValidDimensions() == false)
{
throw YGGDRASIL_EXCEPT_RUNTIME("Tried to use an invalid dimension array for assigning.");
};
//Call the internal function for teh assigning
this->m_data.assign(this->m_data.size(), v); //Assign needs the size
return;
}; //End assign
/* /*
* ================================== * ==================================
* Iterator access function * Iterator access function
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment