share_ptr and Container compilation error on new version

Hello all,
I'm trying to build an application. This isn't an app that I wrote but
rather inherited. I'm currently porting it from Fedora 15 to Fedora 20.
It compiled well on gcc 4.6.3 with boost 1.46.0. However, Fedora 20 has
gcc 4.8.3 and boost 1.54. I'm new to boost and have never used it before
but it looks very comprehensive. As far as I know boost/shared_ptr is
the only header this component of the application is including. I'm
wondering if boost changes might be causing this or maybe gcc changes
but it's difficult to tell from the documentation and I'm a little under
the gun at the moment.
This code:
template<typename Container>
class DefinableVectorFinalizer: public XmlFinalizer
{
typedef typename Container::value_type contained_value_type;
typedef typename Container::value_type::value_type value_type;
....
}
g++ is throwing this error which seems to have some sort of problem with
Container::value_type::value_type:
../../../../../devel/include/xcl/io/DefinableVectorFinalizer.h:31:54:
error: no type named ‘value_type’ in
‘xclApp::DefinableVector
::value_type {aka class boost::shared_ptrmainApp::Project}’ typedef typename Container::value_type::value_type value_type;
xclApp::DefinableVector looks like this: class DefinableVector { public: typedef typename std::vector<T>::size_type size_type; typedef typename std::vector<T>::value_type value_type; typedef value_type& reference; typedef const value_type& const_reference; typedef typename std::vector<T>::iterator iterator; typedef typename std::vector<T>::const_iterator const_iterator; .... } Any insight into this would be hugely appreciated!!!

I just read the header files on the two different version of boost and I think I answered my own question. The equivalent functionality was essentially renamed element_type. I'd still appreciate confirmation that I got that right. Thanks! On 12/11/2014 15:03, JB wrote:

On 12/12/2014 9:03 AM, JB wrote:
Hi JB, I think your problem could be in the line: typedef typename Container::value_type::value_type value_type; try instead: typedef typename Container::value_type value_type; Arthur

On 12/11/2014 20:52, Gruzauskas wrote:
Hi Arthur, thanks for the reply. There is already a declaration for that. The intent of value_type::value_type was to access the value_type attribute of the contained object. I read the header and actually found the answer...I *think*...to be the following due to changes in boost from 1.46 to 1.54: typedef typename Container::value_type::element_type value_type; That certainly resolved the compilation issue. I'll see if it works at run time.
participants (3)
-
Gruzauskas
-
JB
-
Nate Crookston