[Bug c++/58876] New: No non-virtual-dtor warning in std::unique_ptr

2013-10-25 Thread yangzhe1990 at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: yangzhe1990 at gmail dot com When compiling the following code #include struct A { virtual void f() = 0; }; struct B : public A { virtual void f() {}; }; int main() { std::unique_ptr p(new B()); A *q = NULL

[Bug c++/58875] New: No float to int conversion warning in std::inner_product(x, x_end, y, 0)

2013-10-25 Thread yangzhe1990 at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yangzhe1990 at gmail dot com The correct code should be std::inner_product(x, x_end, y, 0.0), but with -Wconversion enabled, there should be a float to int conversion warning

[Bug c++/57986] call to local "bind" template function called std::bind without "using" any namespace.

2013-07-25 Thread yangzhe1990 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57986 --- Comment #9 from yangzhe1990 at gmail dot com --- > is probably including Yes, you are right. is not including . > Make the type non-copyable, and if you need to pass it around then use > shared_ptr Thanks. Anyway there seems no

[Bug c++/57986] call to local "bind" template function called std::bind without "using" any namespace.

2013-07-25 Thread yangzhe1990 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57986 --- Comment #7 from yangzhe1990 at gmail dot com --- Thanks. Now only one question left. Why removing could disable the ADL? BTW, in c++03, to avoid the const_cast, is writing a shared_ptr the right choice?

[Bug c++/57986] call to local "bind" template function called std::bind without "using" any namespace.

2013-07-25 Thread yangzhe1990 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57986 --- Comment #3 from yangzhe1990 at gmail dot com --- Created attachment 30554 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30554&action=edit main program

[Bug c++/57986] call to local "bind" template function called std::bind without "using" any namespace.

2013-07-25 Thread yangzhe1990 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57986 --- Comment #2 from yangzhe1990 at gmail dot com --- Created attachment 30553 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30553&action=edit vector_iterator_asdf and computation functions

[Bug c++/57986] call to local "bind" template function called std::bind without "using" any namespace.

2013-07-25 Thread yangzhe1990 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57986 --- Comment #1 from yangzhe1990 at gmail dot com --- Created attachment 30552 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30552&action=edit thread

[Bug c++/57986] New: call to local "bind" template function called std::bind without "using" any namespace.

2013-07-25 Thread yangzhe1990 at gmail dot com
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yangzhe1990 at gmail dot com Source codes are attached. The compiling cmdline is: g++ numeric_utils_test.cpp -std=c++11 -o numeric_utils_tes

[Bug libstdc++/57925] discrete_distribution can be improved to O(1) per sampling

2013-07-21 Thread yangzhe1990 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57925 --- Comment #2 from yangzhe1990 at gmail dot com --- (In reply to Paolo Carlini from comment #1) > Ok, but since you don't seem to have a Copyright assignment on file, we > can't really use your code and we would have to, eg, ad

[Bug c++/57925] New: discrete_distribution can be improved to O(1) per sampling

2013-07-18 Thread yangzhe1990 at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yangzhe1990 at gmail dot com Current implementation of discrete_distribution employs a strait-forward algorithm by partial_sum and std::lower_bound, which is an O(log n) per sample algorithm

[Bug c/54907] post increasing a value pointed by p in subexpression of an expression modifying p saves the increased value in the wrong place

2012-10-12 Thread yangzhe1990 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54907 --- Comment #2 from yangzhe1990 at gmail dot com 2012-10-12 11:20:39 UTC --- No, p is not modified twice. p is modified once, *p is modified once. (In reply to comment #1) > Not a bug p is modified twice without a seqence point the result

[Bug c/54907] New: post increasing a value pointed by p in subexpression of an expression modifying p saves the increased value in the wrong place

2012-10-12 Thread yangzhe1990 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54907 Bug #: 54907 Summary: post increasing a value pointed by p in subexpression of an expression modifying p saves the increased value in the wrong place Classification: Unclas