Commit Graph

10 Commits

Author SHA1 Message Date
Tomasz Sowa 49e49d1246 fixed: operator==() and operator!=() in iterators in MemBuffer<> template
did not have 'const' modifier and there was an error when compiling with clang with -std=c++20 flag

/usr/home/tomek/roboczy/prog/web.ttmath.org/../pikotools/textstream/textstream.h:225:11: fatal error: use of overloaded operator '!=' is ambiguous (with operand types
      'PT::TextStreamBase<char, 256, 4096>::const_iterator' (aka 'PT::MemBuffer<char, 256, 4096>::const_iterator') and 'PT::TextStreamBase<char, 256, 4096>::const_iterator')
        for( ; i != end() ; ++i)
               ~ ^  ~~~~~
/usr/home/tomek/roboczy/prog/web.ttmath.org/../morm/src/finderhelper.h:78:14: note: in instantiation of member function 'PT::TextStreamBase<char, 256, 4096>::to_string' requested here
                table_name.to_string(table_name_str);
                           ^
/usr/home/tomek/roboczy/prog/web.ttmath.org/../pikotools/membuffer/membuffer.h:93:8: note: candidate function
                bool operator!=(const const_iterator & i);
                     ^
/usr/home/tomek/roboczy/prog/web.ttmath.org/../pikotools/membuffer/membuffer.h:92:8: note: candidate function
                bool operator==(const const_iterator & i);
                     ^
/usr/home/tomek/roboczy/prog/web.ttmath.org/../pikotools/membuffer/membuffer.h:92:8: note: candidate function (with reversed parameter order)
2021-02-17 16:53:19 +01:00
Tomasz Sowa 28ea8f3c3e added: to membuffer:
template<typename in_item_type>
         void append(const in_item_type * item_array, size_t len);
         when adding values from item_array are casted to the type of the internal buffer
changed: some minor optimizations in Space (in Add() methods with WTextStream as an argument)
changed: removed following write() methods from TextStreamBase:
         TextStreamBase & write(const char * buf,    size_t len);
         TextStreamBase & write(const wchar_t * buf, size_t len);
         and added a template instead:
         template<typename in_buffer_type>
         TextStreamBase & write(const in_buffer_type * buf, size_t len);
         this allows to write char* buffer to TextStreamBase<wchar_t...> (and vice versa)
added:   two write() methods to TextStreamBase:
         write(const char * format, double val);
         write(const wchar_t * format, double val);
         converting double value to the text (format is the same as in snprintf)




git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@448 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-11-28 22:21:10 +00:00
Tomasz Sowa 6e57002a90 fixed: in MemBuffer::MemBuffer(const MemBuffer<> & arg)
we have to initialize some variables before calling the operator=



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@434 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-10-27 07:45:39 +00:00
Tomasz Sowa c6c079f8aa some commentaries
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@431 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-09-11 21:41:48 +00:00
Tomasz Sowa 600d0fc34a added: some work in membuffer and textstreambase
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@426 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-10 16:53:26 +00:00
Tomasz Sowa d2d30cf640 added: convert (functions for converting) currently only int(long) -> string
added: textstream (an efficient memory stream for creating strings -- it's using MemBuffer)



git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@425 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-03 14:58:18 +00:00
Tomasz Sowa 64b05fe8d1 added: some work in MemBuffer (copy cctor and assignment operator)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@424 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-02 20:27:31 +00:00
Tomasz Sowa 862dd01ea9 fixed: friend keyword should be used with a type name like 'class'
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@423 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-01 22:49:08 +00:00
Tomasz Sowa 4d968f5a85 added: some work in MemBuffer
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@422 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-01 22:38:27 +00:00
Tomasz Sowa 62f0624539 added: start working on MemBuffer (an efficient memory buffer)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@421 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-07-01 00:39:41 +00:00