[ 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
["DOM functions can be deleted", function () { delete Node.prototype.appendChild; var retVal = !document.appendChild; /* Restore for next iteration */Node.prototype.appendChild = backupAppendChildFunc; return retVal; } ],
あ。
これは駄目だった。
-----
["Cached DOM functions require a 'this' object", function () { var g = document.getElementById; try { var res = g("demobody"); return false; /* this-less invoke should be illegal */ } catch (ex) { } return true; } ],
// New ECMAScript 5 capabilities
["ES5 direct-prototype-access", function () { return Object.getPrototypeOf(document.createElement('div')) == HTMLDivElement.prototype; } ],
["DOM objects can be 'locked' with ES5 preventExtensions", function () { var d = document.createElement('div'); Object.preventExtensions(d); d.extensionVal = "test"; return (d.extensionVal != "test"); } ],
["DOM properties (ES5 accessors) created on appropriate prototypes", function () { return Node.prototype.hasOwnProperty("nodeName"); } ],
["'Get' function of accessor properties can be executed", function () { return document.nodeName == "#document"; } ],
["'Set' function of accessor property can be executed", function () { document.body.lastChild.data = ""; return document.body.lastChild.data == ""; } ],
["DOM accessors can be deleted", function () { delete Element.prototype.tagName; var retVal = document.body.tagName === undefined; /* Restore for next iteration */Object.defineProperty(Element.prototype, "tagName", backupTagNamePropDesc); return retVal; } ],