This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
help with vector code
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 11 Dec 2001 12:57:22 -0800
- Subject: help with vector code
- Organization: Red Hat/San Francisco
- Reply-to: bkoz at redhat dot com
This program gives:
// libstdc++/4456, libstdc++/4457, libstdc++/4458
#include <vector>
void test01()
{
using namespace std;
typedef int mask;
typedef vector<mask> vector_type;
const int max = 255;
vector_type v_c[max];
vector_type v_de[max];
int i = 0;
mask mask_test = static_cast<mask>(0);
mask mask_is = static_cast<mask>(0);
#if 1
vector_type::reference m = v_c[i];
// mask& m = v_c[i];
m = mask_is;
#else
v_c[i] = mask_is;
#endif
}
int main()
{
return 0;
}
gives:
vec_tester.cc: In function `void test01()':
vec_tester.cc:18: cannot convert `void test01()::vector_type' to `int'
in
converting
Ok, first of all, what's up with the error message here? Is it
truncated?
Second of all, isn't it vector_type::reference converting to same? What
am I missing here? I suspect it's simple, and I'm sorry for bugging
y'all.
vector_type::reference m = v_c[i]; // 18
= vector::reference
Ack!
-benjamin