XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: master, 6.14/00
    • Fix Version/s: 6.16/00, 6.14/06
    • Component/s: None
    • Labels:
      None
    • Environment:

      any

      Description

      Due to std::vector<bool> using a different type of allocator internally (Allocator<unsigned long int> for libstdc++) the current implementation of RVec does not compile when a user tries to instantiate a RVec<bool>.

      For example, from the ROOT prompt:

      root [0] ROOT::VecOps::RVec<bool> v2{true,false}
      In file included from /home/eguiraud/ROOT/dbg/input_line_7:1:
      In file included from /home/eguiraud/ROOT/dbg/include/Rtypes.h:188:
      In file included from /home/eguiraud/ROOT/dbg/include/TGenericClassInfo.h:15:
      In file included from /usr/include/c++/6/vector:65:
      /usr/include/c++/6/bits/stl_bvector.h:469:9: error: no matching constructor for initialization of 'std::_Bvector_base<ROOT::Detail::VecOps::RAdoptAllocator<bool> >::_Bvector_impl'
            : _M_impl(__a) { }
              ^       ~~~
      /usr/include/c++/6/bits/stl_bvector.h:652:7: note: in instantiation of member function 'std::_Bvector_base<ROOT::Detail::VecOps::RAdoptAllocator<bool> >::_Bvector_base' requested here
          : _Base(__a)
            ^
      /home/eguiraud/ROOT/dbg/include/ROOT/RVec.hxx:179:42: note: in instantiation of member function 'std::vector<bool, ROOT::Detail::VecOps::RAdoptAllocator<bool> >::vector' requested here
         RVec(std::initializer_list<T> init) : fData(init) {}
                                               ^
      ROOT_prompt_0:1:26: note: in instantiation of member function 'ROOT::VecOps::RVec<bool>::RVec' requested here
      ROOT::VecOps::RVec<bool> v2{true,false}
                               ^
      /usr/include/c++/6/bits/stl_bvector.h:419:14: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const std::_Bvector_base<ROOT::Detail::VecOps::RAdoptAllocator<bool> >::allocator_type'
            (aka 'const ROOT::Detail::VecOps::RAdoptAllocator<bool>') to 'const std::_Bvector_base<ROOT::Detail::VecOps::RAdoptAllocator<bool> >::_Bvector_impl' for 1st argument
            struct _Bvector_impl
                   ^
      /usr/include/c++/6/bits/stl_bvector.h:419:14: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const std::_Bvector_base<ROOT::Detail::VecOps::RAdoptAllocator<bool> >::allocator_type'
            (aka 'const ROOT::Detail::VecOps::RAdoptAllocator<bool>') to 'std::_Bvector_base<ROOT::Detail::VecOps::RAdoptAllocator<bool> >::_Bvector_impl' for 1st argument
            struct _Bvector_impl
                   ^
      /usr/include/c++/6/bits/stl_bvector.h:430:2: note: candidate constructor not viable: no known conversion from 'const RAdoptAllocator<bool>' to 'const RAdoptAllocator<unsigned long>' for 1st argument
              _Bvector_impl(const _Bit_alloc_type& __a)
              ^
      /usr/include/c++/6/bits/stl_bvector.h:435:2: note: candidate constructor not viable: no known conversion from 'const RAdoptAllocator<bool>' to 'RAdoptAllocator<unsigned long>' for 1st argument
              _Bvector_impl(_Bit_alloc_type&& __a)
              ^
      /usr/include/c++/6/bits/stl_bvector.h:426:2: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
              _Bvector_impl()
              ^
      root [1]  

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eguiraud Enrico Guiraud
              Reporter:
              eguiraud Enrico Guiraud
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                PlannedEnd:
                PlannedStart:
                Actual Start:
                Actual End: