Boost logo

Boost Users :

Subject: [Boost-users] BOOST_STRONG_TYPEDEF
From: Jono Poff (jonathan.poff_at_[hidden])
Date: 2014-08-07 20:40:34


Hi,

compiling this program with g++ 4.7.1 ...

             
             #include <boost/serialization/strong_typedef.hpp>
             BOOST_STRONG_TYPEDEF(uint32_t, LINKID_T)

             int main()
             {
                 LINKID_T lid = 0xffddee33;
                 return 0;
             }
             

I get

            
             error: conversion from 'unsigned int' to non-scalar type 'LINKID_T' requested

Looking at the header, the strong typedef struct defines assignment from uint32_t to LINKID_T ...

             D & operator=(const T & rhs) { t = rhs; return *this;}

... so what gives?

Cheers,
Jono

-- 
------------------------------
This email, including any attachments, is only for the intended recipient. 
It is subject to copyright, is confidential and may be the subject of legal 
or other privilege, none of which is waived or lost by reason of this 
transmission.
If you are not an intended recipient, you may not use, disseminate, 
distribute or reproduce such email, any attachments, or any part thereof. 
If you have received a message in error, please notify the sender 
immediately and erase all copies of the message and any attachments.
Unfortunately, we cannot warrant that the email has not been altered or 
corrupted during transmission nor can we guarantee that any email or any 
attachments are free from computer viruses or other conditions which may 
damage or interfere with recipient data, hardware or software. The 
recipient relies upon its own procedures and assumes all risk of use and of 
opening any attachments.
------------------------------

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net