This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename M> | |
M* Create() { | |
ParserQueueMsg* msg = new M; | |
nsAutoLock synchronized(mLock); | |
Push(msg); | |
return static_cast<M*>(msg); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct Nil {}; | |
template <typename H, typename T> | |
class Cons : public T { | |
protected: | |
typedef T BaseType; | |
H mVal; | |
}; | |
class Foo : public Cons<int, Cons<char*, Cons<bool, Nil> > > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct Nil {}; | |
template <typename H, typename T> | |
class Cons : public T { | |
protected: | |
typedef T BaseType; | |
H mVal; | |
public: | |
BaseType &operator()(H aVal) { | |
mVal = aVal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename CAR, typename CDR> | |
class cons : public std::pair<CAR, CDR> | |
{ | |
public: | |
cons(CAR& car, CDR& cdr) | |
: std::pair<CAR, CDR>(car, cdr) | |
{} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/js/src/xpconnect/src/xpcthrower.cpp b/js/src/xpconnect/src/xpcthrower.cpp | |
--- a/js/src/xpconnect/src/xpcthrower.cpp | |
+++ b/js/src/xpconnect/src/xpcthrower.cpp | |
@@ -257,16 +257,18 @@ XPCThrower::BuildAndThrowException(JSCon | |
// most likely out of memory | |
if(!success) | |
JS_ReportOutOfMemory(cx); | |
} | |
static PRBool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct test_struct { | |
double f(int x, double y) { | |
return x + y; | |
} | |
}; | |
double test() { | |
int x = 1; | |
double y = 1.5; | |
test_struct tc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef void (A::*Setter)(int val); | |
void set(A* a, Setter s, int val) { | |
(a->*s)(val); | |
} | |
class A { | |
int mVal; | |
void setVal(int val) { mVal = val; } | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: plugins/Markdown/Markdown.pl | |
=================================================================== | |
--- plugins/Markdown/Markdown.pl (revision 3290) | |
+++ plugins/Markdown/Markdown.pl (working copy) | |
@@ -184,6 +184,8 @@ | |
# contorted like /[ \t]*\n+/ . | |
$text =~ s/^[ \t]+$//mg; | |
+ $text = _DoLaTeX($text); | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: plugins/Markdown/Markdown.pl | |
=================================================================== | |
--- plugins/Markdown/Markdown.pl (revision 3290) | |
+++ plugins/Markdown/Markdown.pl (working copy) | |
@@ -184,6 +184,8 @@ | |
# contorted like /[ \t]*\n+/ . | |
$text =~ s/^[ \t]+$//mg; | |
+ $text = _DoLaTeX($text); | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// Recursive case: | |
template <int N> struct Fib { | |
enum { val = Fib<N-1>::val | |
+ Fib<N-2>::val }; | |
}; | |
// Base cases: | |
template <> struct Fib<0> { enum { val = 0 }; }; |
OlderNewer