Opened 7 years ago

#11708 new Bugs

shared_ptr for void

Reported by: mati_egon@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

Hi, I have been recently working with smart pointers and found out that boost ASIO uses std::shared_ptr for void type under Visual Studio 2013 compiler, what is basically forbidden by standard - void type is an incomplete type that can not be complete. It may lead to broken compilation under future Microsoft compilers, gcc for sure forbids shared_ptr for void type (at least gcc 4.8) throwing static assertion during compilation:

static_assert( !is_void<_Tp1>::value, "incomplete type" );

File: asio/details/socket_ops.hpp:63

typedef shared_ptr<void> shared_cancel_token_type;

Change History (0)

Note: See TracTickets for help on using tickets.