[ Note: if a program could assign a pointer of type T** to a pointer of type const T** (that is, if line #1
below were allowed), a program could inadvertently modify a const object (as it is done on line #2). For
example,
int main() {
const char c = ’c’;
char* pc;
const char** pcc = &pc; // #1: not allowed
*pcc = &c;
*pc = ’C’; // #2: modifies a const object
}
―end note ]
[ Example:
struct B {
int f();
};
struct L : B { };
struct R : B { };
struct D : L, R { };
int (B::*pb)() = &B::f;
int (L::*pl)() = pb;
int (R::*pr)() = pb;
int (D::*pdl)() = pl;
int (D::*pdr)() = pr;
bool x = (pdl == pdr); // false
―end example ]
本の虫: 今まで知らなかったswitch文の仕様 http://cpplover.blogspot.com/2010/07/switch.html
-----
これは酷い。
-----
void f( int const value )
{
int i = 0 ;
switch( value )
for ( ; i != 10 ; ++i )
{
case 1 : case 2 :
std::cout << "value is 1 or 2" << std::endl ;
continue ;
void f( int const value ){
std::cout << value << std::endl;
int i = 0;
switch(value){
for(; i < 3; ++i){
case 0: std::cout << "test" << std::endl;
case 1: std::cout << "google" << std::endl;
}
break;
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored
libs\math\build\..\src\tr1\cyl_bessel_jf.cpp:17:1: warning: visibility attribute
not supported in this configuration; ignored