Jump to content

Fraser

Members
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Fraser

    std::cbegin can return an iterator

    The same problem occurs with std::cend. It is easily fixed by inserting const. I have reported this to Dinkumware.
  2. I am using C++ Builder 10.4 with Dinkumware 8.03. The non-member function std::cbegin sometimes returns an iterator when it should always be a const_iterator. The following program will not compile due to b1 being deduced as iterator and b2 a const_iterator. There is no problem with c1 and c2. The fix is to add const to the parameter _Container & as described in the book. int _tmain(int argc, _TCHAR* argv[]) { std::vector<int> a1(100, 2); std::vector<int> const a2(100, 3); auto const b1= std:: cbegin(a1), b2= std::cbegin(a2); /*auto const c1= a1.cbegin(), c2= a2.cbegin(); */ // See item 13 of Effective Modern C++ for explanation. return 0; } /* line 1672 of xiter template<class _Container> _CONST_FUN auto inline cbegin(_Container& _Cont) _NOEXCEPT_OP(_NOEXCEPT_OP(_STD begin(_Cont))) -> decltype(_STD begin(_Cont)) { // get beginning of sequence return (_STD begin(_Cont)); } */
  3. Fraser

    AnsiString oddities

    There is something not right with the integrated debugger. If you step into the concatenation and out again you will see what you expect. Is it a mistake that you assign a wide character string literal to a char based string type?
  4. Fraser

    shortcuts missing

    On my Windows start button menu some shortcuts of C++ Builder are missing from view but they are present in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Embarcadero RAD Studio 10.1 Berlin. With 10.4 Rad Studio Command Prompt and Uninstall are missing and with 10.3 only Uninstall is missing. With 10.1 another couple are missing.
  5. Fraser

    code completion?

    The <> syntax is used to include library headers and that can include your own library code shared by multiple projects.
  6. Fraser

    code completion?

    After typing #include < there is a selection box with file names. If I ignore that something gets selected anyway and characters from a file name are inserted. I would like to turn it off.
  7. Fraser

    DLL without underscore mangled functions

    I use extern "C" to prevent name mangling like this; extern "C" { __declspec(dllexport) signed char __stdcall MajorVersion() { return 1; }; }
  8. Fraser

    code completion?

    When I type #include < characters get entered automatically that I don't want. I'm not sure what this technology is called but it is a pain. I have some of my own headers that I include with <> because they are used by multiple projects. How is this turned off? I have 10.4 Community.
×