SivaK-5398 avatar image
0 Votes"
SivaK-5398 asked SivaK-5398 commented

Overloaded Template Functions not recognized in VS2019

I have Overloaded Template functions
template< class T, class A1 >
typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1 )
template< class T, class A, class A1 >
typename boost::detail::sp_if_not_array< T >::type make_shared( A const & a, A1 const & a1 )

When I am declaring member functions I am getting error as below

friend boost::shared_ptr<BasicMessage> boost::make_shared<BasicMessage>(std::string const& a1);
friend boost::shared_ptr<BasicMessage> boost::make_shared<BasicMessage>(amqp_bytes_t_ const& a1, amqp_basic_properties_t_* const& a2);

Error C2063 'boost::make_shared': not a function

The same code is working fine in VS2010.

Please help me in resolving this

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for taking time to report this problem with us. Since your question is more related to boost, you could go to SO for support.

0 Votes 0 ·

The second function - the one taking two parameters - is called allocate_shared, not make_shared

0 Votes 0 ·

Thank you for the reply. I have copied the wrong code earlier.
In both the cases I am calling make_shared( ) only.

0 Votes 0 ·

0 Answers