creating a vector of a vector of Gtk::ToggleButton
- From: Rob Benton <rob benton conwaycorp net>
- To: gtkmm-list gnome org
- Subject: creating a vector of a vector of Gtk::ToggleButton
- Date: Wed, 27 Oct 2004 23:27:13 -0500
Ok guys, I would best describe myself as a budding stl programmer. I
have a situation where I need a matrix of toggle buttons but rather than
use an array I'm using a vector of vectors. The error looks to me like
the Gtk::ToggleButton's copy constructor is declared as private but that
seems weird. Here's my code:
CODE
========================================================================
typedef std::vector<Gtk::ToggleButton> chiprow;
std::vector<chiprow> _chips;
const int rows = 10;
const int cols = 10;
for (int i = 0; i < rows; ++i)
{
std::vector<Gtk::ToggleButton> cr;
for (int j = 0; j < cols; ++j)
{
Gtk::ToggleButton tb;
cr.push_back(tb);
}
_chips.push_back(cr);
}
}
========================================================================
I'm attaching the error separately b/c it's long. Am I on the right
track or do I have the wrong approach? Comments appreciated.
/usr/include/gtkmm-2.4/gtkmm/togglebutton.h: In function `void
std::_Construct(_T1*, const _T2&) [with _T1 = Gtk::ToggleButton, _T2 =
Gtk::ToggleButton]':
/usr/include/c++/3.3/bits/stl_vector.h:599: instantiated from `void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = Gtk::ToggleButton, _Alloc = std::allocator<Gtk::ToggleButton>]'
CPU.C:35: instantiated from here
/usr/include/gtkmm-2.4/gtkmm/togglebutton.h:69: error: `
Gtk::ToggleButton::ToggleButton(const Gtk::ToggleButton&)' is private
/usr/include/c++/3.3/bits/stl_construct.h:78: error: within this context
/usr/include/gtkmm-2.4/gtkmm/togglebutton.h: In member function `void
std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<_Tp*,
std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = Gtk::ToggleButton,
_Alloc = std::allocator<Gtk::ToggleButton>]':
/usr/include/c++/3.3/bits/stl_vector.h:603: instantiated from `void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = Gtk::ToggleButton, _Alloc = std::allocator<Gtk::ToggleButton>]'
CPU.C:35: instantiated from here
/usr/include/gtkmm-2.4/gtkmm/togglebutton.h:69: error: `
Gtk::ToggleButton::ToggleButton(const Gtk::ToggleButton&)' is private
/usr/include/c++/3.3/bits/vector.tcc:228: error: within this context
/usr/include/c++/3.3/bits/stl_vector.h:603: instantiated from `void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = Gtk::ToggleButton, _Alloc = std::allocator<Gtk::ToggleButton>]'
CPU.C:35: instantiated from here
/usr/include/gtkmm-2.4/gtkmm/togglebutton.h:70: error: `Gtk::ToggleButton&
Gtk::ToggleButton::operator=(const Gtk::ToggleButton&)' is private
/usr/include/c++/3.3/bits/vector.tcc:230: error: within this context
/usr/include/gtkmm-2.4/gtkmm/togglebutton.h: In function `_BidirectionalIter
std::__copy_backward(_RandomAccessIter, _RandomAccessIter,
_BidirectionalIter, std::random_access_iterator_tag) [with _RandomAccessIter
= Gtk::ToggleButton*, _BidirectionalIter = Gtk::ToggleButton*]':
/usr/include/c++/3.3/bits/stl_algobase.h:392: instantiated from `static _BidirectionalIter2 std::__copy_backward_dispatch<_BidirectionalIter1, _BidirectionalIter2, _BoolType>::copy(_BidirectionalIter1, _BidirectionalIter1, _BidirectionalIter2) [with _BidirectionalIter1 = Gtk::ToggleButton*, _BidirectionalIter2 = Gtk::ToggleButton*, _BoolType = __false_type]'
/usr/include/c++/3.3/bits/stl_algobase.h:427: instantiated from `_BI2 std::__copy_backward_aux(_BI1, _BI1, _BI2) [with _BI1 = Gtk::ToggleButton*, _BI2 = Gtk::ToggleButton*]'
/usr/include/c++/3.3/bits/stl_algobase.h:435: instantiated from `_BI2 std::__copy_backward_output_normal_iterator(_BI1, _BI1, _BI2, __true_type) [with _BI1 = Gtk::ToggleButton*, _BI2 = __gnu_cxx::__normal_iterator<Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >]'
/usr/include/c++/3.3/bits/stl_algobase.h:449: instantiated from `_BI2 std::__copy_backward_input_normal_iterator(_BI1, _BI1, _BI2, __true_type) [with _BI1 = __gnu_cxx::__normal_iterator<Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >, _BI2 = __gnu_cxx::__normal_iterator<Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >]'
/usr/include/c++/3.3/bits/stl_algobase.h:489: instantiated from `_BI2 std::copy_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator<Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >, _BI2 = __gnu_cxx::__normal_iterator<Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >]'
/usr/include/c++/3.3/bits/vector.tcc:229: instantiated from `void std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = Gtk::ToggleButton, _Alloc = std::allocator<Gtk::ToggleButton>]'
/usr/include/c++/3.3/bits/stl_vector.h:603: instantiated from `void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = Gtk::ToggleButton, _Alloc = std::allocator<Gtk::ToggleButton>]'
CPU.C:35: instantiated from here
/usr/include/gtkmm-2.4/gtkmm/togglebutton.h:70: error: `Gtk::ToggleButton&
Gtk::ToggleButton::operator=(const Gtk::ToggleButton&)' is private
/usr/include/c++/3.3/bits/stl_algobase.h:374: error: within this context
/usr/include/gtkmm-2.4/gtkmm/togglebutton.h: In function `_OutputIter
std::__copy(_RandomAccessIter, _RandomAccessIter, _OutputIter,
std::random_access_iterator_tag) [with _RandomAccessIter = const
Gtk::ToggleButton*, _OutputIter = Gtk::ToggleButton*]':
/usr/include/c++/3.3/bits/stl_algobase.h:260: instantiated from `_OutputIter std::__copy_aux2(_InputIter, _InputIter, _OutputIter, __false_type) [with _InputIter = const Gtk::ToggleButton*, _OutputIter = Gtk::ToggleButton*]'
/usr/include/c++/3.3/bits/stl_algobase.h:289: instantiated from `_OutputIter std::__copy_ni2(_InputIter, _InputIter, _OutputIter, __true_type) [with _InputIter = const Gtk::ToggleButton*, _OutputIter = __gnu_cxx::__normal_iterator<Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >]'
/usr/include/c++/3.3/bits/stl_algobase.h:314: instantiated from `_OutputIter std::__copy_ni1(_InputIter, _InputIter, _OutputIter, __true_type) [with _InputIter = __gnu_cxx::__normal_iterator<const Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >, _OutputIter = __gnu_cxx::__normal_iterator<Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >]'
/usr/include/c++/3.3/bits/stl_algobase.h:349: instantiated from `_OutputIter std::copy(_InputIter, _InputIter, _OutputIter) [with _InputIter = __gnu_cxx::__normal_iterator<const Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >, _OutputIter = __gnu_cxx::__normal_iterator<Gtk::ToggleButton*, std::vector<Gtk::ToggleButton, std::allocator<Gtk::ToggleButton> > >]'
/usr/include/c++/3.3/bits/vector.tcc:142: instantiated from `std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = Gtk::ToggleButton, _Alloc = std::allocator<Gtk::ToggleButton>]'
/usr/include/c++/3.3/bits/stl_algobase.h:374: instantiated from `_BidirectionalIter std::__copy_backward(_RandomAccessIter, _RandomAccessIter, _BidirectionalIter, std::random_access_iterator_tag) [with _RandomAccessIter = _chiprow*, _BidirectionalIter = _chiprow*]'
/usr/include/c++/3.3/bits/stl_algobase.h:392: instantiated from `static _BidirectionalIter2 std::__copy_backward_dispatch<_BidirectionalIter1, _BidirectionalIter2, _BoolType>::copy(_BidirectionalIter1, _BidirectionalIter1, _BidirectionalIter2) [with _BidirectionalIter1 = _chiprow*, _BidirectionalIter2 = _chiprow*, _BoolType = __false_type]'
/usr/include/c++/3.3/bits/stl_algobase.h:427: instantiated from `_BI2 std::__copy_backward_aux(_BI1, _BI1, _BI2) [with _BI1 = _chiprow*, _BI2 = _chiprow*]'
/usr/include/c++/3.3/bits/stl_algobase.h:435: instantiated from `_BI2 std::__copy_backward_output_normal_iterator(_BI1, _BI1, _BI2, __true_type) [with _BI1 = _chiprow*, _BI2 = __gnu_cxx::__normal_iterator<_chiprow*, std::vector<_chiprow, std::allocator<_chiprow> > >]'
/usr/include/c++/3.3/bits/stl_algobase.h:449: instantiated from `_BI2 std::__copy_backward_input_normal_iterator(_BI1, _BI1, _BI2, __true_type) [with _BI1 = __gnu_cxx::__normal_iterator<_chiprow*, std::vector<_chiprow, std::allocator<_chiprow> > >, _BI2 = __gnu_cxx::__normal_iterator<_chiprow*, std::vector<_chiprow, std::allocator<_chiprow> > >]'
/usr/include/c++/3.3/bits/stl_algobase.h:489: instantiated from `_BI2 std::copy_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator<_chiprow*, std::vector<_chiprow, std::allocator<_chiprow> > >, _BI2 = __gnu_cxx::__normal_iterator<_chiprow*, std::vector<_chiprow, std::allocator<_chiprow> > >]'
/usr/include/c++/3.3/bits/vector.tcc:229: instantiated from `void std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = _chiprow, _Alloc = std::allocator<_chiprow>]'
/usr/include/c++/3.3/bits/stl_vector.h:603: instantiated from `void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = _chiprow, _Alloc = std::allocator<_chiprow>]'
CPU.C:38: instantiated from here
/usr/include/gtkmm-2.4/gtkmm/togglebutton.h:70: error: `Gtk::ToggleButton&
Gtk::ToggleButton::operator=(const Gtk::ToggleButton&)' is private
/usr/include/c++/3.3/bits/stl_algobase.h:241: error: within this context
make[2]: *** [CPU.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]