[Stlport-devel] deque not properly initialized
Brought to you by:
complement
From: Kees de B. <kee...@al...> - 2010-12-01 12:38:44
|
Hi, The following code fails because the deque<> is not properly initialized: #include <queue> #include <cstdio> int main(void) { std::deque<char> dx02(2, 'z'); std::deque<char>::iterator ix02 = dx02.begin(); while (ix02 != dx02.end()) { std::printf("dx02.item() = %c\n", (char)(*ix02)); ++ix02; } return 0; } I get: dx02.item() = dx02.item() = I'm using the latest sources from GIT and found that the initialization is not done because the _M_fill_initialize() function does noting for a type where has_trivial_default_constructor::type() returns true_type(). The function is called in the deque<>(size_type, const value_type&, const allocator_type&) constructor. Changing to false_type() solves the problem. Regards, -- Kees. |