[17:19:00] <Kemet> vlad2: тут?
[17:24:52] <vlad2> Да!
[17:25:28] <Kemet> даров, смотри, есть такой темплейт
[17:25:39] <Kemet>    template<class T, unsigned Size> class pod_auto_array
   {
   public:
       typedef T value_type;
       typedef pod_auto_array<T, Size> self_type;

       pod_auto_array() {}
       explicit pod_auto_array(const T* c)
       {
           memcpy(m_array, c, sizeof(T) * Size);
       }

       const self_type& operator = (const T* c)
       {
           memcpy(m_array, c, sizeof(T) * Size);
           return *this;
       }

       static unsigned size() { return Size; }
       const T& operator [] (unsigned i) const { return m_array[i]; }
             T& operator [] (unsigned i)       { return m_array[i]; }
       const T& at(unsigned i) const           { return m_array[i]; }
             T& at(unsigned i)                 { return m_array[i]; }
       T  value_at(unsigned i) const           { return m_array[i]; }

   private:
       T m_array[Size];
   };

[17:27:17] <Kemet> вот я тут туплю, где тут имплементация t[i] = x? ну то есть присвоение элемента через []
[17:30:04] <Kemet> ибо есть
   typedef agg::pod_auto_array<ColorType, 256> GradientArray;

GradientArray                   m_fillGradient;
m_fillGradient[i] = c2;
[18:05:48] <vlad2> Дык, T& operator [] (unsigned i)       { return m_array[i]; }
[18:06:00] <vlad2> Это оно и есть.
[18:06:25] <vlad2> Возвращается ссылка, прэтому присваивание работает.
[18:06:41] <vlad2> Простэпайся в дебагере ;)
[18:07:54] <vlad2> А вообще нафига козе баян - смысл этого темплейта для меня ускользает.
[18:32:10] <Kemet> vlad2: мля, богомерзкий язык., да.
ну я хз пока зачем он - в самой AGG не используется, только в примерах, но есть похожие
[18:32:33] <Kemet> я думаю, просто чтоб не привязываться к либам, типа все свое ношу с собой
[18:33:07] <Kemet> там простой массив , простой вектор
[18:33:18] <Kemet> стек
[18:34:47] <Kemet> я где то читал, на рсдн, вроде, автор писал, что сознательно не использует либы, и по минимуму темплейты
[18:50:27] <Kemet> vlad2:    // The policy of all AGG containers and memory allocation strategy
   // in general is that no allocated data requires explicit construction.
   // It means that the allocator can be really simple; you can even
   // replace new/delete to malloc/free. The constructors and destructors
   // won't be called in this case, however everything will remain working.
   // The second argument of deallocate() is the size of the allocated
   // block. You can use this information if you wish.