Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. bool question?

bool question?

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rene De La Garza
    wrote on last edited by
    #1

    im trying to serialize something but this works; ar << m_bool; and this doesn`t: ar >> m_bool; why?

    dangD 1 Reply Last reply
    0
    • R Rene De La Garza

      im trying to serialize something but this works; ar << m_bool; and this doesn`t: ar >> m_bool; why?

      dangD Offline
      dangD Offline
      dang
      wrote on last edited by
      #2

      i notice in "afx.h" that the CArchive class does not have an explicit override for '<< bool' so this may be the problem. try casting it like this (as an experiment): ar << (int)m_bool; ar >> (int&)m_bool;

      .dan.g.

      R 1 Reply Last reply
      0
      • dangD dang

        i notice in "afx.h" that the CArchive class does not have an explicit override for '<< bool' so this may be the problem. try casting it like this (as an experiment): ar << (int)m_bool; ar >> (int&)m_bool;

        R Offline
        R Offline
        Rene De La Garza
        wrote on last edited by
        #3

        thanks it compiles just let me check if it works fine:-D

        M 1 Reply Last reply
        0
        • R Rene De La Garza

          thanks it compiles just let me check if it works fine:-D

          M Offline
          M Offline
          Mike Nordell
          wrote on last edited by
          #4

          As already explained, this was just an experiment. For "the real stuff" you should provide your own streaming operators like: CArchive& operator<<(CArchive&, bool); CArchive& operator>>(CArchive&, bool&);

          R 1 Reply Last reply
          0
          • M Mike Nordell

            As already explained, this was just an experiment. For "the real stuff" you should provide your own streaming operators like: CArchive& operator<<(CArchive&, bool); CArchive& operator>>(CArchive&, bool&);

            R Offline
            R Offline
            Rene De La Garza
            wrote on last edited by
            #5

            thanks i just did that. :-D

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups