Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 990 / Compilation issues with C++11 and libc++ #993

Merged
merged 4 commits into from
Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/aeif_cond_alpha_multisynapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ aeif_cond_alpha_multisynapse::insert_conductance_recordables( size_t first )
DataAccessFunctor< aeif_cond_alpha_multisynapse >
aeif_cond_alpha_multisynapse::get_data_access_functor( size_t elem )
{
return DataAccessFunctor< aeif_cond_alpha_multisynapse >( this, elem );
return DataAccessFunctor< aeif_cond_alpha_multisynapse >( *this, elem );
}

/* ----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion models/aeif_cond_beta_multisynapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ aeif_cond_beta_multisynapse::insert_conductance_recordables( size_t first )
DataAccessFunctor< aeif_cond_beta_multisynapse >
aeif_cond_beta_multisynapse::get_data_access_functor( size_t elem )
{
return DataAccessFunctor< aeif_cond_beta_multisynapse >( this, elem );
return DataAccessFunctor< aeif_cond_beta_multisynapse >( *this, elem );
}

/* ----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion models/iaf_psc_alpha_multisynapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ iaf_psc_alpha_multisynapse::insert_current_recordables( size_t first )
DataAccessFunctor< iaf_psc_alpha_multisynapse >
iaf_psc_alpha_multisynapse::get_data_access_functor( size_t elem )
{
return DataAccessFunctor< iaf_psc_alpha_multisynapse >( this, elem );
return DataAccessFunctor< iaf_psc_alpha_multisynapse >( *this, elem );
}

/* ----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion models/iaf_psc_exp_multisynapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ iaf_psc_exp_multisynapse::insert_current_recordables( size_t first )
DataAccessFunctor< iaf_psc_exp_multisynapse >
iaf_psc_exp_multisynapse::get_data_access_functor( size_t elem )
{
return DataAccessFunctor< iaf_psc_exp_multisynapse >( this, elem );
return DataAccessFunctor< iaf_psc_exp_multisynapse >( *this, elem );
}

/* ----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion nestkernel/nest_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace nest

#ifdef HAVE_LONG_LONG
typedef long long tic_t;
#ifdef IS_K
#ifdef LLONG_MAX
const tic_t tic_t_max = LLONG_MAX;
const tic_t tic_t_min = LLONG_MIN;
#else
Expand Down
26 changes: 6 additions & 20 deletions nestkernel/recordables_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,34 +135,20 @@ RecordablesMap< HostNode >::create()
template < typename HostNode >
class DataAccessFunctor
{
// Pointer instead of reference required to avoid problems with
// copying element in std::map when using libc++ under C++11.
HostNode* parent_;
size_t elem_;

public:
DataAccessFunctor( HostNode& n, size_t elem )
: elem_( elem )
{
parent_ = &n;
};

DataAccessFunctor( HostNode* n, size_t elem )
: elem_( elem )
{
parent_ = n;
};
: parent_( &n )
, elem_( elem ){};

double operator()() const
{
return parent_->get_state_element( elem_ );
};

DataAccessFunctor< HostNode >& operator=(
const DataAccessFunctor< HostNode >& other )
{
this->elem_ = other.elem_;
this->parent_ = other.parent_;
return *this;
}
};


Expand All @@ -181,9 +167,9 @@ class DataAccessFunctor
*/
template < typename HostNode >
class DynamicRecordablesMap
: public std::map< Name, const DataAccessFunctor< HostNode > >
: public std::map< Name, DataAccessFunctor< HostNode > >
{
typedef std::map< Name, const DataAccessFunctor< HostNode > > Base_;
typedef std::map< Name, DataAccessFunctor< HostNode > > Base_;

public:
virtual ~DynamicRecordablesMap()
Expand Down