Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x = some_bool ? printf("WTF"), 5 : fprintf(stderr, "No, really, WTF"), 117;
- a = rand();
- ++a;
- b = rand();
- c = a + b / 2;
- if (a < c - 5)
- d = a;
- else
- d = b;
- a = rand(), ++a, b = rand(), c = a + b / 2, a < c - 5 ? d = a : d = b;
- a = rand(), ++a, b = rand(), c = a + b / 2, d = a < c - 5 ? a : b;
- d = (a = rand(), ++a, b = rand(), c = a + b / 2, a < c - 5 ? a : b);
- a = rand(), ++a, b = rand(), c = a + b / 2, (a < c - 5 && (d = a, 1)) || (d = b);
- #define SomeMacro(A) ( DoWork(A), Permute(A) )
- while (cin >> str, str != "STOP") {
- //process str
- }
- class X : public A {
- X() : A( (global_function(), global_result) ) {};
- };
- class NamedMutex : public boost::timed_mutex
- {
- public:
- ...
- private:
- std::string name_ ;
- };
- void log( NamedMutex & ref__ , std::string const& name__ )
- {
- LOG( name__ << " waits for " << ref__.name_ );
- }
- class NamedUniqueLock : public boost::unique_lock< NamedMutex >
- {
- public:
- NamedUniqueLock::NamedUniqueLock(
- NamedMutex & ref__ ,
- std::string const& name__ ,
- size_t const& nbmilliseconds )
- :
- boost::unique_lock< NamedMutex >( ( log( ref__ , name__ ) , ref__ ) ,
- boost::get_system_time() + boost::posix_time::milliseconds( nbmilliseconds ) ),
- ref_( ref__ ),
- name_( name__ )
- {
- }
- ....
- };
- int a, b, c;
- int a, b, c;
- for(a = 0, b = 10; c += 2*a+b, a <= b; a++, b--);
- printf("%d", c);
- #define malloc(size) (printf("malloc(%d)n", (int)(size)), malloc((size)))
- delete p, p = 0;
- using namespace boost::assign;
- vector<int> v;
- v += 1,2,3,4,5,6,7,8,9;
- foo=bar*2, plugh=hoo+7;
- foo=bar*2;
- plugh=hoo+7;
- if (a==1)
- ... do something ...
- else if (function_with_side_effects_including_setting_b(), b==2)
- ... do something that relies on the side effects ...
- void* s_static_pointer = 0;
- void init() {
- configureLib();
- s_static_pointer = calculateFancyStuff(x,y,z);
- regptr(s_static_pointer);
- }
- bool s_init = init(), true; // just run init() before anything else
- Foo::Foo() {
- s_static_pointer->doStuff(); // works properly
- }
- int ans = isRunning() ? total += 10, newAnswer(total) : 0;
- #define ASSIGN_INCR(p, val, type) ((*((type) *)(p) = (val)), (p) += sizeof(type))
- if (need_to_output_short)
- ASSIGN_INCR(ptr, short_value, short);
- latest_pos = ASSIGN_INCR(ptr, int_value, int);
- send_buff(outbuff, (int)(ASSIGN_INCR(ptr, last_value, int) - outbuff));
- ASSERT(("This value must be true.", x));
Add Comment
Please, Sign In to add comment