Skip to content

Instantly share code, notes, and snippets.

@dobrokot
dobrokot / may_be.hpp
Created April 10, 2012 08:52
nullable/optinal/MayBe - store some value or empty
#ifndef MAY_BE_HEADER
#define MAY_BE_HEADER
#include <string.h>
#include <memory>
#include <assert.h>
///для того, что бы удобней было вернуть из функции пустое или дефолтное значение, например
/** \code
MayBe<Point> f() {
@dobrokot
dobrokot / may_be.hpp
Created April 10, 2012 08:45
nullable/optinal/MayBe - store some value or empty.
#ifndef MAY_BE_HEADER
#define MAY_BE_HEADER
#include <string.h>
#include <memory>
#include <assert.h>
///для того, что бы удобней было вернуть из функции пустое или дефолтное значение, например
/** \code
MayBe<Point> f() {
// Determine support properties
(function( xhr ) {
jQuery.extend( jQuery.support, {
ajax: !!xhr,
cors: !!xhr && ( "withCredentials" in xhr )
});
})( jQuery.ajaxSettings.xhr() );