Skip to content

Commit 78d8e1d

Browse files
committed
note from en.cppreference.com
1 parent 65390b5 commit 78d8e1d

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

src/uncertain/usegment.cpp

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -284,37 +284,21 @@ void uStraightLineSegment::transform( const Matrix9d & TT)
284284
}
285285

286286

287-
/* /! Serialization of the uncertain straight line segment t=[l',m',n']' and its bounding box
288-
void uStraightLineSegment::serialize( QDataStream & out ) const
289-
{
290-
//qDebug() << Q_FUNC_INFO;
291-
out << m_t;
292-
out << m_Cov_tt;
293-
out << m_bounding_box;
294-
}*/
295-
296-
297-
/* /! Deserialization of uncertain straight line segment and its bounding box
298-
bool uStraightLineSegment::deserialize( QDataStream & in )
299-
{
300-
// qDebug() << Q_FUNC_INFO;
301-
in >> m_t;
302-
in >> m_Cov_tt;
303-
in >> m_bounding_box;
304-
305-
return in.status() == QDataStream::Ok;
306-
}*/
307-
308-
309287
//! Create uncertain straight line segment (for deserialization)
310288
std::shared_ptr<uStraightLineSegment>
311289
uStraightLineSegment::create()
312290
{
313-
return std::shared_ptr<uStraightLineSegment>(
314-
new uStraightLineSegment()
315-
);
316-
// TODO(meijoc)
317-
// return std::make_shared<uStraightLineSegment>(); // why not?
291+
return std::shared_ptr<uStraightLineSegment>(
292+
new uStraightLineSegment()
293+
);
294+
// return std::make_shared<uStraightLineSegment>();
295+
296+
// Note from
297+
// https://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared.html:
298+
//
299+
// std::shared_ptr<T>(new T(args...)) may call a non-public constructor
300+
// of T if executed in context where it is accessible, while
301+
// std::make_shared requires public access to the selected constructor.
318302
}
319303

320304
} // namespace Uncertain

0 commit comments

Comments
 (0)