webruby 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/webruby +36 -0
- data/driver/driver.c +50 -0
- data/driver/main.c +40 -0
- data/lib/webruby/app.rb +13 -0
- data/lib/webruby/config.rb +61 -0
- data/lib/webruby/environment.rb +32 -0
- data/lib/webruby/rake/files.rake +66 -0
- data/lib/webruby/rake/general.rake +22 -0
- data/lib/webruby/rake/mruby.rake +44 -0
- data/lib/webruby/utility.rb +132 -0
- data/lib/webruby.rb +10 -0
- data/modules/emscripten/AUTHORS +89 -0
- data/modules/emscripten/LICENSE +68 -0
- data/modules/emscripten/README.markdown +14 -0
- data/modules/emscripten/cmake/Platform/Emscripten.cmake +61 -0
- data/modules/emscripten/cmake/Platform/Emscripten_unix.cmake +24 -0
- data/modules/emscripten/em++ +12 -0
- data/modules/emscripten/em++.bat +2 -0
- data/modules/emscripten/em-config +24 -0
- data/modules/emscripten/em-config.bat +2 -0
- data/modules/emscripten/emar +24 -0
- data/modules/emscripten/emar.bat +2 -0
- data/modules/emscripten/emcc +1744 -0
- data/modules/emscripten/emcc.bat +2 -0
- data/modules/emscripten/emcc.py +5 -0
- data/modules/emscripten/emconfigure +27 -0
- data/modules/emscripten/emconfigure.bat +2 -0
- data/modules/emscripten/emlibtool +11 -0
- data/modules/emscripten/emlibtool.bat +2 -0
- data/modules/emscripten/emlink.py +293 -0
- data/modules/emscripten/emmake +29 -0
- data/modules/emscripten/emmake.bat +2 -0
- data/modules/emscripten/emranlib +9 -0
- data/modules/emscripten/emranlib.bat +2 -0
- data/modules/emscripten/emscons +20 -0
- data/modules/emscripten/emscripten.py +835 -0
- data/modules/emscripten/patches/README +4 -0
- data/modules/emscripten/patches/series +2 -0
- data/modules/emscripten/scons-tools/closure.py +28 -0
- data/modules/emscripten/scons-tools/emscripten.py +359 -0
- data/modules/emscripten/scons-tools/llvm.py +33 -0
- data/modules/emscripten/src/analyzer.js +1695 -0
- data/modules/emscripten/src/compiler.html +48 -0
- data/modules/emscripten/src/compiler.js +298 -0
- data/modules/emscripten/src/corruptionCheck.js +98 -0
- data/modules/emscripten/src/determinstic.js +20 -0
- data/modules/emscripten/src/embind/embind.js +1677 -0
- data/modules/emscripten/src/embind/emval.js +283 -0
- data/modules/emscripten/src/experimental/allow_loopvars_from_memsetcpy_inasm.diff +97 -0
- data/modules/emscripten/src/experimental/batching.diff +44 -0
- data/modules/emscripten/src/experimental/functypeopt.diff +113 -0
- data/modules/emscripten/src/experimental/multiple_heaps.diff +175 -0
- data/modules/emscripten/src/experimental/noncallgraphprofiling.diff +197 -0
- data/modules/emscripten/src/experimental/optimize_memcpy_for_ta1.diff +124 -0
- data/modules/emscripten/src/experimental/remove__label__s.diff +140 -0
- data/modules/emscripten/src/experimental/renderer_cache_hash.diff +99 -0
- data/modules/emscripten/src/experimental/sdl_key_forwarding.diff +57 -0
- data/modules/emscripten/src/experimental/simplifyGeneratedFunctionsDetection.diff +336 -0
- data/modules/emscripten/src/experimental/stringCache.diff +147 -0
- data/modules/emscripten/src/fastLong.js +299 -0
- data/modules/emscripten/src/framework.js +257 -0
- data/modules/emscripten/src/gl-matrix.js +1952 -0
- data/modules/emscripten/src/headless.js +904 -0
- data/modules/emscripten/src/intertyper.js +1050 -0
- data/modules/emscripten/src/jsifier.js +1827 -0
- data/modules/emscripten/src/library.js +8270 -0
- data/modules/emscripten/src/library_browser.js +911 -0
- data/modules/emscripten/src/library_egl.js +491 -0
- data/modules/emscripten/src/library_gc.js +236 -0
- data/modules/emscripten/src/library_gl.js +4452 -0
- data/modules/emscripten/src/library_glfw.js +576 -0
- data/modules/emscripten/src/library_glut.js +449 -0
- data/modules/emscripten/src/library_jansson.js +320 -0
- data/modules/emscripten/src/library_openal.js +602 -0
- data/modules/emscripten/src/library_sdl.js +2024 -0
- data/modules/emscripten/src/library_strtok_r.c +97 -0
- data/modules/emscripten/src/library_xlib.js +23 -0
- data/modules/emscripten/src/long.js +1609 -0
- data/modules/emscripten/src/modules.js +491 -0
- data/modules/emscripten/src/parseTools.js +2474 -0
- data/modules/emscripten/src/postamble.js +170 -0
- data/modules/emscripten/src/postamble_sharedlib.js +16 -0
- data/modules/emscripten/src/preamble.js +914 -0
- data/modules/emscripten/src/preamble_sharedlib.js +25 -0
- data/modules/emscripten/src/relooper/README.markdown +14 -0
- data/modules/emscripten/src/relooper/Relooper.cpp +1236 -0
- data/modules/emscripten/src/relooper/Relooper.h +250 -0
- data/modules/emscripten/src/relooper/doit.sh +70 -0
- data/modules/emscripten/src/relooper/emscripten/glue.js +57 -0
- data/modules/emscripten/src/relooper/emscripten/test.js +44 -0
- data/modules/emscripten/src/relooper/fuzzer.py +116 -0
- data/modules/emscripten/src/relooper/ministring.h +35 -0
- data/modules/emscripten/src/relooper/paper.pdf +0 -0
- data/modules/emscripten/src/relooper/test.cpp +262 -0
- data/modules/emscripten/src/relooper/test.txt +155 -0
- data/modules/emscripten/src/relooper/test2.c +44 -0
- data/modules/emscripten/src/relooper/test2.txt +12 -0
- data/modules/emscripten/src/relooper/test3.c +42 -0
- data/modules/emscripten/src/relooper/test3.txt +27 -0
- data/modules/emscripten/src/relooper/test4.cpp +40 -0
- data/modules/emscripten/src/relooper/test4.txt +23 -0
- data/modules/emscripten/src/relooper/test5.cpp +40 -0
- data/modules/emscripten/src/relooper/test5.txt +32 -0
- data/modules/emscripten/src/relooper/test6.cpp +31 -0
- data/modules/emscripten/src/relooper/test6.txt +12 -0
- data/modules/emscripten/src/relooper/test_dead.cpp +28 -0
- data/modules/emscripten/src/relooper/test_dead.txt +9 -0
- data/modules/emscripten/src/relooper/test_debug.cpp +30 -0
- data/modules/emscripten/src/relooper/test_debug.txt +128 -0
- data/modules/emscripten/src/relooper/test_fuzz1.cpp +52 -0
- data/modules/emscripten/src/relooper/test_fuzz1.txt +32 -0
- data/modules/emscripten/src/relooper/test_fuzz2.cpp +34 -0
- data/modules/emscripten/src/relooper/test_fuzz2.txt +13 -0
- data/modules/emscripten/src/relooper/test_fuzz3.cpp +36 -0
- data/modules/emscripten/src/relooper/test_fuzz3.txt +9 -0
- data/modules/emscripten/src/relooper/test_fuzz4.cpp +38 -0
- data/modules/emscripten/src/relooper/test_fuzz4.txt +19 -0
- data/modules/emscripten/src/relooper/test_fuzz5.cpp +57 -0
- data/modules/emscripten/src/relooper/test_fuzz5.txt +52 -0
- data/modules/emscripten/src/relooper/test_fuzz6.cpp +322 -0
- data/modules/emscripten/src/relooper/test_fuzz6.txt +108 -0
- data/modules/emscripten/src/relooper/test_inf.cpp +813 -0
- data/modules/emscripten/src/relooper/test_inf.txt +385 -0
- data/modules/emscripten/src/relooper/testit.sh +62 -0
- data/modules/emscripten/src/relooper/updateit.sh +17 -0
- data/modules/emscripten/src/relooper.js +11516 -0
- data/modules/emscripten/src/relooper.js.raw.js +11511 -0
- data/modules/emscripten/src/runtime.js +546 -0
- data/modules/emscripten/src/settings.js +1284 -0
- data/modules/emscripten/src/shell.html +92 -0
- data/modules/emscripten/src/shell.js +153 -0
- data/modules/emscripten/src/shell_sharedlib.js +12 -0
- data/modules/emscripten/src/socket.io.js +3870 -0
- data/modules/emscripten/src/utility.js +379 -0
- data/modules/emscripten/src/wrtcp.js +821 -0
- data/modules/emscripten/system/include/AL/al.h +172 -0
- data/modules/emscripten/system/include/AL/alc.h +84 -0
- data/modules/emscripten/system/include/EGL/egl.h +329 -0
- data/modules/emscripten/system/include/EGL/eglext.h +398 -0
- data/modules/emscripten/system/include/EGL/eglplatform.h +141 -0
- data/modules/emscripten/system/include/GL/freeglut_std.h +628 -0
- data/modules/emscripten/system/include/GL/gl.h +2241 -0
- data/modules/emscripten/system/include/GL/glew.h +6 -0
- data/modules/emscripten/system/include/GL/glext.h +11127 -0
- data/modules/emscripten/system/include/GL/glfw.h +518 -0
- data/modules/emscripten/system/include/GL/glu.h +353 -0
- data/modules/emscripten/system/include/GL/glut.h +21 -0
- data/modules/emscripten/system/include/GLES/gl.h +770 -0
- data/modules/emscripten/system/include/GLES/glext.h +1278 -0
- data/modules/emscripten/system/include/GLES/glplatform.h +30 -0
- data/modules/emscripten/system/include/GLES2/gl2.h +621 -0
- data/modules/emscripten/system/include/GLES2/gl2ext.h +803 -0
- data/modules/emscripten/system/include/GLES2/gl2platform.h +30 -0
- data/modules/emscripten/system/include/KHR/khrplatform.h +277 -0
- data/modules/emscripten/system/include/SDL/COPYING +19 -0
- data/modules/emscripten/system/include/SDL/SDL.h +162 -0
- data/modules/emscripten/system/include/SDL/SDL_assert.h +241 -0
- data/modules/emscripten/system/include/SDL/SDL_atomic.h +318 -0
- data/modules/emscripten/system/include/SDL/SDL_audio.h +509 -0
- data/modules/emscripten/system/include/SDL/SDL_blendmode.h +60 -0
- data/modules/emscripten/system/include/SDL/SDL_clipboard.h +75 -0
- data/modules/emscripten/system/include/SDL/SDL_compat.h +365 -0
- data/modules/emscripten/system/include/SDL/SDL_config.h +48 -0
- data/modules/emscripten/system/include/SDL/SDL_config.h.in +297 -0
- data/modules/emscripten/system/include/SDL/SDL_config_android.h +133 -0
- data/modules/emscripten/system/include/SDL/SDL_config_iphoneos.h +148 -0
- data/modules/emscripten/system/include/SDL/SDL_config_macosx.h +172 -0
- data/modules/emscripten/system/include/SDL/SDL_config_minimal.h +74 -0
- data/modules/emscripten/system/include/SDL/SDL_config_nintendods.h +129 -0
- data/modules/emscripten/system/include/SDL/SDL_config_pandora.h +125 -0
- data/modules/emscripten/system/include/SDL/SDL_config_windows.h +207 -0
- data/modules/emscripten/system/include/SDL/SDL_config_wiz.h +119 -0
- data/modules/emscripten/system/include/SDL/SDL_copying.h +20 -0
- data/modules/emscripten/system/include/SDL/SDL_cpuinfo.h +150 -0
- data/modules/emscripten/system/include/SDL/SDL_endian.h +248 -0
- data/modules/emscripten/system/include/SDL/SDL_error.h +77 -0
- data/modules/emscripten/system/include/SDL/SDL_events.h +639 -0
- data/modules/emscripten/system/include/SDL/SDL_gesture.h +91 -0
- data/modules/emscripten/system/include/SDL/SDL_gfxPrimitives.h +246 -0
- data/modules/emscripten/system/include/SDL/SDL_haptic.h +1200 -0
- data/modules/emscripten/system/include/SDL/SDL_hints.h +206 -0
- data/modules/emscripten/system/include/SDL/SDL_image.h +138 -0
- data/modules/emscripten/system/include/SDL/SDL_input.h +87 -0
- data/modules/emscripten/system/include/SDL/SDL_joystick.h +208 -0
- data/modules/emscripten/system/include/SDL/SDL_keyboard.h +169 -0
- data/modules/emscripten/system/include/SDL/SDL_keycode.h +344 -0
- data/modules/emscripten/system/include/SDL/SDL_loadso.h +85 -0
- data/modules/emscripten/system/include/SDL/SDL_log.h +211 -0
- data/modules/emscripten/system/include/SDL/SDL_main.h +98 -0
- data/modules/emscripten/system/include/SDL/SDL_mixer.h +634 -0
- data/modules/emscripten/system/include/SDL/SDL_mouse.h +213 -0
- data/modules/emscripten/system/include/SDL/SDL_mutex.h +248 -0
- data/modules/emscripten/system/include/SDL/SDL_name.h +11 -0
- data/modules/emscripten/system/include/SDL/SDL_opengl.h +11116 -0
- data/modules/emscripten/system/include/SDL/SDL_opengles.h +38 -0
- data/modules/emscripten/system/include/SDL/SDL_opengles2.h +38 -0
- data/modules/emscripten/system/include/SDL/SDL_pixels.h +423 -0
- data/modules/emscripten/system/include/SDL/SDL_platform.h +160 -0
- data/modules/emscripten/system/include/SDL/SDL_power.h +79 -0
- data/modules/emscripten/system/include/SDL/SDL_quit.h +58 -0
- data/modules/emscripten/system/include/SDL/SDL_rect.h +136 -0
- data/modules/emscripten/system/include/SDL/SDL_render.h +615 -0
- data/modules/emscripten/system/include/SDL/SDL_revision.h +2 -0
- data/modules/emscripten/system/include/SDL/SDL_revision.h.orig +2 -0
- data/modules/emscripten/system/include/SDL/SDL_rotozoom.h +123 -0
- data/modules/emscripten/system/include/SDL/SDL_rwops.h +220 -0
- data/modules/emscripten/system/include/SDL/SDL_scancode.h +398 -0
- data/modules/emscripten/system/include/SDL/SDL_shape.h +147 -0
- data/modules/emscripten/system/include/SDL/SDL_stdinc.h +764 -0
- data/modules/emscripten/system/include/SDL/SDL_surface.h +499 -0
- data/modules/emscripten/system/include/SDL/SDL_syswm.h +241 -0
- data/modules/emscripten/system/include/SDL/SDL_thread.h +182 -0
- data/modules/emscripten/system/include/SDL/SDL_timer.h +108 -0
- data/modules/emscripten/system/include/SDL/SDL_touch.h +124 -0
- data/modules/emscripten/system/include/SDL/SDL_ttf.h +249 -0
- data/modules/emscripten/system/include/SDL/SDL_types.h +29 -0
- data/modules/emscripten/system/include/SDL/SDL_version.h +166 -0
- data/modules/emscripten/system/include/SDL/SDL_video.h +820 -0
- data/modules/emscripten/system/include/SDL/begin_code.h +135 -0
- data/modules/emscripten/system/include/SDL/close_code.h +37 -0
- data/modules/emscripten/system/include/X11/X.h +717 -0
- data/modules/emscripten/system/include/X11/Xatom.h +79 -0
- data/modules/emscripten/system/include/X11/Xfuncproto.h +127 -0
- data/modules/emscripten/system/include/X11/Xlib.h +4023 -0
- data/modules/emscripten/system/include/X11/Xosdefs.h +116 -0
- data/modules/emscripten/system/include/X11/Xutil.h +826 -0
- data/modules/emscripten/system/include/X11/keysym.h +73 -0
- data/modules/emscripten/system/include/X11/keysymdef.h +2389 -0
- data/modules/emscripten/system/include/bsd/float.h +91 -0
- data/modules/emscripten/system/include/bsd/readme.txt +2 -0
- data/modules/emscripten/system/include/bsd/sys/mman.h +180 -0
- data/modules/emscripten/system/include/bsd/sys/utsname.h +70 -0
- data/modules/emscripten/system/include/dlfcn.h +31 -0
- data/modules/emscripten/system/include/emscripten/bind.h +1210 -0
- data/modules/emscripten/system/include/emscripten/emscripten.h +388 -0
- data/modules/emscripten/system/include/emscripten/val.h +311 -0
- data/modules/emscripten/system/include/emscripten/wire.h +393 -0
- data/modules/emscripten/system/include/err.h +95 -0
- data/modules/emscripten/system/include/execinfo.h +44 -0
- data/modules/emscripten/system/include/features.h +3 -0
- data/modules/emscripten/system/include/gc.h +70 -0
- data/modules/emscripten/system/include/gfx/png.h +3798 -0
- data/modules/emscripten/system/include/gfx/pngconf.h +1665 -0
- data/modules/emscripten/system/include/gfx/tiff.h +654 -0
- data/modules/emscripten/system/include/gfx/tiffconf.h +104 -0
- data/modules/emscripten/system/include/gfx/tiffio.h +526 -0
- data/modules/emscripten/system/include/gfx/tiffvers.h +9 -0
- data/modules/emscripten/system/include/jansson.h +323 -0
- data/modules/emscripten/system/include/jansson_config.h +54 -0
- data/modules/emscripten/system/include/libc/_ansi.h +135 -0
- data/modules/emscripten/system/include/libc/_syslist.h +40 -0
- data/modules/emscripten/system/include/libc/alloca.h +21 -0
- data/modules/emscripten/system/include/libc/ar.h +69 -0
- data/modules/emscripten/system/include/libc/argz.h +33 -0
- data/modules/emscripten/system/include/libc/assert.h +46 -0
- data/modules/emscripten/system/include/libc/complex.h +124 -0
- data/modules/emscripten/system/include/libc/ctype.h +196 -0
- data/modules/emscripten/system/include/libc/dirent.h +16 -0
- data/modules/emscripten/system/include/libc/endian.h +3 -0
- data/modules/emscripten/system/include/libc/envlock.h +15 -0
- data/modules/emscripten/system/include/libc/envz.h +16 -0
- data/modules/emscripten/system/include/libc/errno.h +11 -0
- data/modules/emscripten/system/include/libc/fastmath.h +13 -0
- data/modules/emscripten/system/include/libc/fcntl.h +1 -0
- data/modules/emscripten/system/include/libc/fnmatch.h +55 -0
- data/modules/emscripten/system/include/libc/getopt.h +196 -0
- data/modules/emscripten/system/include/libc/glob.h +89 -0
- data/modules/emscripten/system/include/libc/grp.h +94 -0
- data/modules/emscripten/system/include/libc/iconv.h +62 -0
- data/modules/emscripten/system/include/libc/ieeefp.h +256 -0
- data/modules/emscripten/system/include/libc/ifaddrs.h +64 -0
- data/modules/emscripten/system/include/libc/inttypes.h +290 -0
- data/modules/emscripten/system/include/libc/iso646.h +43 -0
- data/modules/emscripten/system/include/libc/langinfo.h +316 -0
- data/modules/emscripten/system/include/libc/libgen.h +23 -0
- data/modules/emscripten/system/include/libc/limits.h +155 -0
- data/modules/emscripten/system/include/libc/locale.h +80 -0
- data/modules/emscripten/system/include/libc/machine/_default_types.h +121 -0
- data/modules/emscripten/system/include/libc/machine/_types.h +8 -0
- data/modules/emscripten/system/include/libc/machine/ansi.h +1 -0
- data/modules/emscripten/system/include/libc/machine/endian.h +31 -0
- data/modules/emscripten/system/include/libc/machine/fastmath.h +100 -0
- data/modules/emscripten/system/include/libc/machine/ieeefp.h +376 -0
- data/modules/emscripten/system/include/libc/machine/malloc.h +8 -0
- data/modules/emscripten/system/include/libc/machine/param.h +1 -0
- data/modules/emscripten/system/include/libc/machine/setjmp-dj.h +43 -0
- data/modules/emscripten/system/include/libc/machine/setjmp.h +361 -0
- data/modules/emscripten/system/include/libc/machine/stdlib.h +8 -0
- data/modules/emscripten/system/include/libc/machine/termios.h +1 -0
- data/modules/emscripten/system/include/libc/machine/time.h +19 -0
- data/modules/emscripten/system/include/libc/machine/types.h +30 -0
- data/modules/emscripten/system/include/libc/malloc.h +169 -0
- data/modules/emscripten/system/include/libc/math.h +594 -0
- data/modules/emscripten/system/include/libc/newlib.h +2 -0
- data/modules/emscripten/system/include/libc/paths.h +7 -0
- data/modules/emscripten/system/include/libc/process.h +44 -0
- data/modules/emscripten/system/include/libc/pthread.h +362 -0
- data/modules/emscripten/system/include/libc/pwd.h +78 -0
- data/modules/emscripten/system/include/libc/readme.txt +3 -0
- data/modules/emscripten/system/include/libc/reent.h +183 -0
- data/modules/emscripten/system/include/libc/regdef.h +7 -0
- data/modules/emscripten/system/include/libc/regex.h +102 -0
- data/modules/emscripten/system/include/libc/sched.h +97 -0
- data/modules/emscripten/system/include/libc/search.h +59 -0
- data/modules/emscripten/system/include/libc/setjmp.h +20 -0
- data/modules/emscripten/system/include/libc/signal.h +30 -0
- data/modules/emscripten/system/include/libc/stdarg.h +50 -0
- data/modules/emscripten/system/include/libc/stddef.h +64 -0
- data/modules/emscripten/system/include/libc/stdint.h +493 -0
- data/modules/emscripten/system/include/libc/stdio.h +694 -0
- data/modules/emscripten/system/include/libc/stdlib.h +230 -0
- data/modules/emscripten/system/include/libc/string.h +105 -0
- data/modules/emscripten/system/include/libc/strings.h +35 -0
- data/modules/emscripten/system/include/libc/sys/_default_fcntl.h +223 -0
- data/modules/emscripten/system/include/libc/sys/_types.h +93 -0
- data/modules/emscripten/system/include/libc/sys/cdefs.h +123 -0
- data/modules/emscripten/system/include/libc/sys/config.h +255 -0
- data/modules/emscripten/system/include/libc/sys/custom_file.h +2 -0
- data/modules/emscripten/system/include/libc/sys/dir.h +10 -0
- data/modules/emscripten/system/include/libc/sys/dirent.h +58 -0
- data/modules/emscripten/system/include/libc/sys/errno.h +190 -0
- data/modules/emscripten/system/include/libc/sys/fcntl.h +4 -0
- data/modules/emscripten/system/include/libc/sys/features.h +212 -0
- data/modules/emscripten/system/include/libc/sys/file.h +2 -0
- data/modules/emscripten/system/include/libc/sys/iconvnls.h +77 -0
- data/modules/emscripten/system/include/libc/sys/lock.h +24 -0
- data/modules/emscripten/system/include/libc/sys/param.h +25 -0
- data/modules/emscripten/system/include/libc/sys/queue.h +471 -0
- data/modules/emscripten/system/include/libc/sys/reent.h +843 -0
- data/modules/emscripten/system/include/libc/sys/resource.h +59 -0
- data/modules/emscripten/system/include/libc/sys/sched.h +67 -0
- data/modules/emscripten/system/include/libc/sys/signal.h +314 -0
- data/modules/emscripten/system/include/libc/sys/stat.h +222 -0
- data/modules/emscripten/system/include/libc/sys/stdio.h +27 -0
- data/modules/emscripten/system/include/libc/sys/string.h +2 -0
- data/modules/emscripten/system/include/libc/sys/syslimits.h +65 -0
- data/modules/emscripten/system/include/libc/sys/termios.h +280 -0
- data/modules/emscripten/system/include/libc/sys/time.h +85 -0
- data/modules/emscripten/system/include/libc/sys/timeb.h +39 -0
- data/modules/emscripten/system/include/libc/sys/times.h +28 -0
- data/modules/emscripten/system/include/libc/sys/ttydefaults.h +97 -0
- data/modules/emscripten/system/include/libc/sys/types.h +481 -0
- data/modules/emscripten/system/include/libc/sys/unistd.h +514 -0
- data/modules/emscripten/system/include/libc/sys/utime.h +26 -0
- data/modules/emscripten/system/include/libc/sys/wait.h +40 -0
- data/modules/emscripten/system/include/libc/tar.h +39 -0
- data/modules/emscripten/system/include/libc/termios.h +7 -0
- data/modules/emscripten/system/include/libc/time.h +273 -0
- data/modules/emscripten/system/include/libc/unctrl.h +46 -0
- data/modules/emscripten/system/include/libc/unistd.h +6 -0
- data/modules/emscripten/system/include/libc/utime.h +12 -0
- data/modules/emscripten/system/include/libc/utmp.h +8 -0
- data/modules/emscripten/system/include/libc/wchar.h +194 -0
- data/modules/emscripten/system/include/libc/wctype.h +47 -0
- data/modules/emscripten/system/include/libc/wordexp.h +53 -0
- data/modules/emscripten/system/include/libcxx/CREDITS.TXT +91 -0
- data/modules/emscripten/system/include/libcxx/LICENSE.txt +76 -0
- data/modules/emscripten/system/include/libcxx/__bit_reference +1268 -0
- data/modules/emscripten/system/include/libcxx/__config +485 -0
- data/modules/emscripten/system/include/libcxx/__debug +193 -0
- data/modules/emscripten/system/include/libcxx/__functional_03 +2130 -0
- data/modules/emscripten/system/include/libcxx/__functional_base +437 -0
- data/modules/emscripten/system/include/libcxx/__functional_base_03 +1087 -0
- data/modules/emscripten/system/include/libcxx/__hash_table +1945 -0
- data/modules/emscripten/system/include/libcxx/__locale +1435 -0
- data/modules/emscripten/system/include/libcxx/__mutex_base +438 -0
- data/modules/emscripten/system/include/libcxx/__split_buffer +654 -0
- data/modules/emscripten/system/include/libcxx/__sso_allocator +77 -0
- data/modules/emscripten/system/include/libcxx/__std_stream +317 -0
- data/modules/emscripten/system/include/libcxx/__tree +2293 -0
- data/modules/emscripten/system/include/libcxx/__tuple +305 -0
- data/modules/emscripten/system/include/libcxx/__tuple_03 +27 -0
- data/modules/emscripten/system/include/libcxx/__undef_min_max +19 -0
- data/modules/emscripten/system/include/libcxx/algorithm +5458 -0
- data/modules/emscripten/system/include/libcxx/array +341 -0
- data/modules/emscripten/system/include/libcxx/atomic +1521 -0
- data/modules/emscripten/system/include/libcxx/bitset +1081 -0
- data/modules/emscripten/system/include/libcxx/cassert +25 -0
- data/modules/emscripten/system/include/libcxx/ccomplex +29 -0
- data/modules/emscripten/system/include/libcxx/cctype +164 -0
- data/modules/emscripten/system/include/libcxx/cerrno +393 -0
- data/modules/emscripten/system/include/libcxx/cfenv +82 -0
- data/modules/emscripten/system/include/libcxx/cfloat +78 -0
- data/modules/emscripten/system/include/libcxx/chrono +898 -0
- data/modules/emscripten/system/include/libcxx/cinttypes +259 -0
- data/modules/emscripten/system/include/libcxx/ciso646 +25 -0
- data/modules/emscripten/system/include/libcxx/climits +48 -0
- data/modules/emscripten/system/include/libcxx/clocale +53 -0
- data/modules/emscripten/system/include/libcxx/cmath +1683 -0
- data/modules/emscripten/system/include/libcxx/codecvt +547 -0
- data/modules/emscripten/system/include/libcxx/complex +1526 -0
- data/modules/emscripten/system/include/libcxx/complex.h +35 -0
- data/modules/emscripten/system/include/libcxx/condition_variable +256 -0
- data/modules/emscripten/system/include/libcxx/csetjmp +52 -0
- data/modules/emscripten/system/include/libcxx/csignal +58 -0
- data/modules/emscripten/system/include/libcxx/cstdarg +48 -0
- data/modules/emscripten/system/include/libcxx/cstdbool +32 -0
- data/modules/emscripten/system/include/libcxx/cstddef +103 -0
- data/modules/emscripten/system/include/libcxx/cstdint +191 -0
- data/modules/emscripten/system/include/libcxx/cstdio +175 -0
- data/modules/emscripten/system/include/libcxx/cstdlib +172 -0
- data/modules/emscripten/system/include/libcxx/cstring +112 -0
- data/modules/emscripten/system/include/libcxx/ctgmath +29 -0
- data/modules/emscripten/system/include/libcxx/ctime +72 -0
- data/modules/emscripten/system/include/libcxx/cwchar +208 -0
- data/modules/emscripten/system/include/libcxx/cwctype +213 -0
- data/modules/emscripten/system/include/libcxx/deque +2846 -0
- data/modules/emscripten/system/include/libcxx/exception +250 -0
- data/modules/emscripten/system/include/libcxx/ext/__hash +46 -0
- data/modules/emscripten/system/include/libcxx/ext/hash_map +1003 -0
- data/modules/emscripten/system/include/libcxx/ext/hash_set +657 -0
- data/modules/emscripten/system/include/libcxx/forward_list +1636 -0
- data/modules/emscripten/system/include/libcxx/fstream +1415 -0
- data/modules/emscripten/system/include/libcxx/functional +2063 -0
- data/modules/emscripten/system/include/libcxx/future +2505 -0
- data/modules/emscripten/system/include/libcxx/initializer_list +105 -0
- data/modules/emscripten/system/include/libcxx/iomanip +504 -0
- data/modules/emscripten/system/include/libcxx/ios +988 -0
- data/modules/emscripten/system/include/libcxx/iosfwd +194 -0
- data/modules/emscripten/system/include/libcxx/iostream +60 -0
- data/modules/emscripten/system/include/libcxx/istream +1713 -0
- data/modules/emscripten/system/include/libcxx/iterator +1869 -0
- data/modules/emscripten/system/include/libcxx/limits +809 -0
- data/modules/emscripten/system/include/libcxx/list +2275 -0
- data/modules/emscripten/system/include/libcxx/locale +4591 -0
- data/modules/emscripten/system/include/libcxx/map +1924 -0
- data/modules/emscripten/system/include/libcxx/memory +5437 -0
- data/modules/emscripten/system/include/libcxx/mutex +566 -0
- data/modules/emscripten/system/include/libcxx/new +117 -0
- data/modules/emscripten/system/include/libcxx/numeric +197 -0
- data/modules/emscripten/system/include/libcxx/ostream +1286 -0
- data/modules/emscripten/system/include/libcxx/queue +717 -0
- data/modules/emscripten/system/include/libcxx/random +6750 -0
- data/modules/emscripten/system/include/libcxx/ratio +487 -0
- data/modules/emscripten/system/include/libcxx/readme.txt +1 -0
- data/modules/emscripten/system/include/libcxx/regex +6439 -0
- data/modules/emscripten/system/include/libcxx/scoped_allocator +578 -0
- data/modules/emscripten/system/include/libcxx/set +1025 -0
- data/modules/emscripten/system/include/libcxx/sstream +888 -0
- data/modules/emscripten/system/include/libcxx/stack +292 -0
- data/modules/emscripten/system/include/libcxx/stdexcept +162 -0
- data/modules/emscripten/system/include/libcxx/streambuf +564 -0
- data/modules/emscripten/system/include/libcxx/string +3987 -0
- data/modules/emscripten/system/include/libcxx/strstream +400 -0
- data/modules/emscripten/system/include/libcxx/support/solaris/floatingpoint.h +5 -0
- data/modules/emscripten/system/include/libcxx/support/solaris/wchar.h +38 -0
- data/modules/emscripten/system/include/libcxx/support/solaris/xlocale.h +146 -0
- data/modules/emscripten/system/include/libcxx/support/win32/limits_win32.h +79 -0
- data/modules/emscripten/system/include/libcxx/support/win32/locale_win32.h +116 -0
- data/modules/emscripten/system/include/libcxx/support/win32/math_win32.h +113 -0
- data/modules/emscripten/system/include/libcxx/support/win32/support.h +115 -0
- data/modules/emscripten/system/include/libcxx/system_error +636 -0
- data/modules/emscripten/system/include/libcxx/tgmath.h +29 -0
- data/modules/emscripten/system/include/libcxx/thread +459 -0
- data/modules/emscripten/system/include/libcxx/tuple +1092 -0
- data/modules/emscripten/system/include/libcxx/type_traits +3040 -0
- data/modules/emscripten/system/include/libcxx/typeindex +103 -0
- data/modules/emscripten/system/include/libcxx/typeinfo +124 -0
- data/modules/emscripten/system/include/libcxx/unordered_map +1864 -0
- data/modules/emscripten/system/include/libcxx/unordered_set +1144 -0
- data/modules/emscripten/system/include/libcxx/utility +583 -0
- data/modules/emscripten/system/include/libcxx/valarray +4779 -0
- data/modules/emscripten/system/include/libcxx/vector +3228 -0
- data/modules/emscripten/system/include/memory.h +10 -0
- data/modules/emscripten/system/include/mntent.h +23 -0
- data/modules/emscripten/system/include/net/arpa/inet.h +32 -0
- data/modules/emscripten/system/include/net/arpa/nameser.h +535 -0
- data/modules/emscripten/system/include/net/arpa/nameser_compat.h +187 -0
- data/modules/emscripten/system/include/net/if.h +87 -0
- data/modules/emscripten/system/include/net/netinet/in.h +166 -0
- data/modules/emscripten/system/include/net/netinet/tcp.h +246 -0
- data/modules/emscripten/system/include/net/resolv.h +389 -0
- data/modules/emscripten/system/include/netdb.h +94 -0
- data/modules/emscripten/system/include/nl_types.h +19 -0
- data/modules/emscripten/system/include/poll.h +3 -0
- data/modules/emscripten/system/include/pty.h +6 -0
- data/modules/emscripten/system/include/semaphore.h +31 -0
- data/modules/emscripten/system/include/spawn.h +105 -0
- data/modules/emscripten/system/include/stdbool.h +16 -0
- data/modules/emscripten/system/include/sys/bitypes.h +3 -0
- data/modules/emscripten/system/include/sys/io.h +14 -0
- data/modules/emscripten/system/include/sys/ioctl.h +26 -0
- data/modules/emscripten/system/include/sys/poll.h +31 -0
- data/modules/emscripten/system/include/sys/select.h +14 -0
- data/modules/emscripten/system/include/sys/socket.h +101 -0
- data/modules/emscripten/system/include/sys/socketvar.h +3 -0
- data/modules/emscripten/system/include/sys/statvfs.h +32 -0
- data/modules/emscripten/system/include/sys/sysctl.h +14 -0
- data/modules/emscripten/system/include/sys/uio.h +22 -0
- data/modules/emscripten/system/include/sys/un.h +66 -0
- data/modules/emscripten/system/include/sysexits.h +108 -0
- data/modules/emscripten/system/include/unwind.h +154 -0
- data/modules/emscripten/system/include/xlocale.h +47 -0
- data/modules/emscripten/system/include/zconf.h +428 -0
- data/modules/emscripten/system/include/zlib.h +1613 -0
- data/modules/emscripten/system/lib/compiler-rt/LICENSE.TXT +97 -0
- data/modules/emscripten/system/lib/compiler-rt/divdi3.c +47 -0
- data/modules/emscripten/system/lib/compiler-rt/int_endianness.h +116 -0
- data/modules/emscripten/system/lib/compiler-rt/int_lib.h +46 -0
- data/modules/emscripten/system/lib/compiler-rt/int_math.h +67 -0
- data/modules/emscripten/system/lib/compiler-rt/int_types.h +140 -0
- data/modules/emscripten/system/lib/compiler-rt/int_util.h +29 -0
- data/modules/emscripten/system/lib/compiler-rt/muldi3.c +56 -0
- data/modules/emscripten/system/lib/compiler-rt/readme.txt +20 -0
- data/modules/emscripten/system/lib/compiler-rt/udivdi3.c +36 -0
- data/modules/emscripten/system/lib/compiler-rt/udivmoddi4.c +251 -0
- data/modules/emscripten/system/lib/debugging.cpp +24 -0
- data/modules/emscripten/system/lib/dlmalloc.c +6299 -0
- data/modules/emscripten/system/lib/embind/bind.cpp +63 -0
- data/modules/emscripten/system/lib/libc/gen/err.c +49 -0
- data/modules/emscripten/system/lib/libc/gen/errx.c +49 -0
- data/modules/emscripten/system/lib/libc/gen/verr.c +58 -0
- data/modules/emscripten/system/lib/libc/gen/verrx.c +51 -0
- data/modules/emscripten/system/lib/libc/gen/vwarn.c +55 -0
- data/modules/emscripten/system/lib/libc/gen/vwarnx.c +48 -0
- data/modules/emscripten/system/lib/libc/gen/warn.c +49 -0
- data/modules/emscripten/system/lib/libc/gen/warnx.c +49 -0
- data/modules/emscripten/system/lib/libc/musl/COPYRIGHT +92 -0
- data/modules/emscripten/system/lib/libc/musl/readme.txt +1 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/alpha.h +125 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalnum.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalpha.c +14 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswblank.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswcntrl.c +10 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswctype.c +63 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswdigit.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswgraph.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswlower.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswprint.c +19 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswpunct.c +12 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswspace.c +19 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswupper.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswxdigit.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/nonspacing.h +62 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/punct.h +109 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/towctrans.c +268 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcswidth.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wctrans.c +16 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c +29 -0
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wide.h +42 -0
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.c +22 -0
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.h +71 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/btowc.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.c +38 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.h +22 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mblen.c +17 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrlen.c +18 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrtowc.c +57 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsinit.c +17 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsnrtowcs.c +65 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsrtowcs.c +100 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbstowcs.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbtowc.c +53 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcrtomb.c +38 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsnrtombs.c +52 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsrtombs.c +58 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcstombs.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctob.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctomb.c +18 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpcpy.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpncpy.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscat.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcschr.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscmp.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscpy.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscspn.c +10 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsdup.c +11 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcslen.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp_l.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncat.c +10 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncmp.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncpy.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsnlen.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcspbrk.c +7 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsrchr.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsspn.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsstr.c +108 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcstok.c +12 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wcswcs.c +6 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemchr.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcmp.c +8 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcpy.c +9 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemmove.c +12 -0
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemset.c +9 -0
- data/modules/emscripten/system/lib/libc/stdlib/getopt_long.c +511 -0
- data/modules/emscripten/system/lib/libc/stdlib/strtod.c +305 -0
- data/modules/emscripten/system/lib/libc.symbols +81 -0
- data/modules/emscripten/system/lib/libcextra.symbols +61 -0
- data/modules/emscripten/system/lib/libcxx/CREDITS.TXT +91 -0
- data/modules/emscripten/system/lib/libcxx/LICENSE.txt +76 -0
- data/modules/emscripten/system/lib/libcxx/algorithm.cpp +83 -0
- data/modules/emscripten/system/lib/libcxx/bind.cpp +30 -0
- data/modules/emscripten/system/lib/libcxx/chrono.cpp +132 -0
- data/modules/emscripten/system/lib/libcxx/condition_variable.cpp +81 -0
- data/modules/emscripten/system/lib/libcxx/debug.cpp +504 -0
- data/modules/emscripten/system/lib/libcxx/exception.cpp +226 -0
- data/modules/emscripten/system/lib/libcxx/future.cpp +285 -0
- data/modules/emscripten/system/lib/libcxx/hash.cpp +564 -0
- data/modules/emscripten/system/lib/libcxx/ios.cpp +455 -0
- data/modules/emscripten/system/lib/libcxx/iostream.cpp +68 -0
- data/modules/emscripten/system/lib/libcxx/locale.cpp +6093 -0
- data/modules/emscripten/system/lib/libcxx/memory.cpp +223 -0
- data/modules/emscripten/system/lib/libcxx/mutex.cpp +250 -0
- data/modules/emscripten/system/lib/libcxx/new.cpp +205 -0
- data/modules/emscripten/system/lib/libcxx/random.cpp +48 -0
- data/modules/emscripten/system/lib/libcxx/readme.txt +1 -0
- data/modules/emscripten/system/lib/libcxx/regex.cpp +325 -0
- data/modules/emscripten/system/lib/libcxx/stdexcept.cpp +196 -0
- data/modules/emscripten/system/lib/libcxx/string.cpp +687 -0
- data/modules/emscripten/system/lib/libcxx/strstream.cpp +329 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/README +4 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/mbsnrtowcs.inc +76 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/wcsnrtombs.inc +93 -0
- data/modules/emscripten/system/lib/libcxx/support/solaris/xlocale.c +245 -0
- data/modules/emscripten/system/lib/libcxx/support/win32/locale_win32.cpp +94 -0
- data/modules/emscripten/system/lib/libcxx/support/win32/support.cpp +70 -0
- data/modules/emscripten/system/lib/libcxx/symbols +2927 -0
- data/modules/emscripten/system/lib/libcxx/system_error.cpp +201 -0
- data/modules/emscripten/system/lib/libcxx/thread.cpp +208 -0
- data/modules/emscripten/system/lib/libcxx/typeinfo.cpp +60 -0
- data/modules/emscripten/system/lib/libcxx/utility.cpp +17 -0
- data/modules/emscripten/system/lib/libcxx/valarray.cpp +54 -0
- data/modules/emscripten/system/lib/libcxxabi/CREDITS.TXT +38 -0
- data/modules/emscripten/system/lib/libcxxabi/LICENSE.TXT +76 -0
- data/modules/emscripten/system/lib/libcxxabi/include/cxa_demangle.h +167 -0
- data/modules/emscripten/system/lib/libcxxabi/include/cxxabi.h +175 -0
- data/modules/emscripten/system/lib/libcxxabi/lib/buildit +99 -0
- data/modules/emscripten/system/lib/libcxxabi/readme.txt +1 -0
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.cpp +50 -0
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.h +33 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_aux_runtime.cpp +34 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_demangle.cpp +11036 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.cpp +622 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.hpp +123 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception_storage.cpp +91 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_guard.cpp +231 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.cpp +125 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.hpp +54 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_new_delete.cpp +242 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_personality.cpp +1055 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_unexpected.cpp +27 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_vector.cpp +367 -0
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_virtual.cpp +31 -0
- data/modules/emscripten/system/lib/libcxxabi/src/exception.cpp +41 -0
- data/modules/emscripten/system/lib/libcxxabi/src/fallback_malloc.ipp +174 -0
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp +1146 -0
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.h +248 -0
- data/modules/emscripten/system/lib/libcxxabi/src/stdexcept.cpp +169 -0
- data/modules/emscripten/system/lib/libcxxabi/src/typeinfo.cpp +53 -0
- data/modules/emscripten/system/lib/libcxxabi/symbols +236 -0
- data/modules/emscripten/system/lib/sdl.cpp +13 -0
- data/modules/emscripten/system/lib/sdl.symbols +1 -0
- data/modules/emscripten/tests/hello_world.js +92 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py +2347 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/__init__.py +4 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/doc/CppHeaderParser.html +657 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/SampleClass.h +147 -0
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/readSampleClass.py +74 -0
- data/modules/emscripten/third_party/CppHeaderParser/PKG-INFO +249 -0
- data/modules/emscripten/third_party/CppHeaderParser/README.html +544 -0
- data/modules/emscripten/third_party/CppHeaderParser/README.txt +226 -0
- data/modules/emscripten/third_party/CppHeaderParser/setup.py +43 -0
- data/modules/emscripten/third_party/ansidecl.h +371 -0
- data/modules/emscripten/third_party/closure-compiler/COPYING +202 -0
- data/modules/emscripten/third_party/closure-compiler/README +292 -0
- data/modules/emscripten/third_party/closure-compiler/compiler.jar +0 -0
- data/modules/emscripten/third_party/closure-compiler/readme.txt +3 -0
- data/modules/emscripten/third_party/cp-demangle.h +161 -0
- data/modules/emscripten/third_party/demangle.h +549 -0
- data/modules/emscripten/third_party/demangler.py +49 -0
- data/modules/emscripten/third_party/gcc_demangler.c +4226 -0
- data/modules/emscripten/third_party/gcc_demangler.js +21282 -0
- data/modules/emscripten/third_party/jni/emjvm.cpp +133 -0
- data/modules/emscripten/third_party/jni/emjvm.h +8 -0
- data/modules/emscripten/third_party/jni/emjvm.js +185 -0
- data/modules/emscripten/third_party/jni/jni.h +1154 -0
- data/modules/emscripten/third_party/libiberty.h +634 -0
- data/modules/emscripten/third_party/lzma.js/README.markdown +37 -0
- data/modules/emscripten/third_party/lzma.js/doit.sh +37 -0
- data/modules/emscripten/third_party/lzma.js/lzip/AUTHORS +7 -0
- data/modules/emscripten/third_party/lzma.js/lzip/COPYING +676 -0
- data/modules/emscripten/third_party/lzma.js/lzip/ChangeLog +201 -0
- data/modules/emscripten/third_party/lzma.js/lzip/INSTALL +56 -0
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile +160 -0
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile.in +138 -0
- data/modules/emscripten/third_party/lzma.js/lzip/NEWS +22 -0
- data/modules/emscripten/third_party/lzma.js/lzip/README +77 -0
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.cc +204 -0
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.h +106 -0
- data/modules/emscripten/third_party/lzma.js/lzip/configure +192 -0
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.cc +252 -0
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.h +268 -0
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.cc +643 -0
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.h +582 -0
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.cc +378 -0
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.h +171 -0
- data/modules/emscripten/third_party/lzma.js/lzip/lzip.h +264 -0
- data/modules/emscripten/third_party/lzma.js/lzip/main.cc +545 -0
- data/modules/emscripten/third_party/lzma.js/lzma-decoder.js +27 -0
- data/modules/emscripten/third_party/lzma.js/lzma-full.js +27 -0
- data/modules/emscripten/third_party/lzma.js/native_test.sh +5 -0
- data/modules/emscripten/third_party/lzma.js/post.js +13 -0
- data/modules/emscripten/third_party/lzma.js/pre.js +13 -0
- data/modules/emscripten/third_party/lzma.js/test-decoder.js +39 -0
- data/modules/emscripten/third_party/lzma.js/test-full.html +9 -0
- data/modules/emscripten/third_party/lzma.js/test-full.js +78 -0
- data/modules/emscripten/third_party/ply/ANNOUNCE +40 -0
- data/modules/emscripten/third_party/ply/CHANGES +1093 -0
- data/modules/emscripten/third_party/ply/PKG-INFO +22 -0
- data/modules/emscripten/third_party/ply/README +271 -0
- data/modules/emscripten/third_party/ply/TODO +16 -0
- data/modules/emscripten/third_party/ply/doc/internal.html +874 -0
- data/modules/emscripten/third_party/ply/doc/makedoc.py +194 -0
- data/modules/emscripten/third_party/ply/doc/ply.html +3262 -0
- data/modules/emscripten/third_party/ply/example/BASIC/README +79 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basic.py +71 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basiclex.py +74 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basiclog.py +79 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basinterp.py +441 -0
- data/modules/emscripten/third_party/ply/example/BASIC/basparse.py +424 -0
- data/modules/emscripten/third_party/ply/example/BASIC/dim.bas +14 -0
- data/modules/emscripten/third_party/ply/example/BASIC/func.bas +5 -0
- data/modules/emscripten/third_party/ply/example/BASIC/gcd.bas +22 -0
- data/modules/emscripten/third_party/ply/example/BASIC/gosub.bas +13 -0
- data/modules/emscripten/third_party/ply/example/BASIC/hello.bas +4 -0
- data/modules/emscripten/third_party/ply/example/BASIC/linear.bas +17 -0
- data/modules/emscripten/third_party/ply/example/BASIC/maxsin.bas +12 -0
- data/modules/emscripten/third_party/ply/example/BASIC/powers.bas +13 -0
- data/modules/emscripten/third_party/ply/example/BASIC/rand.bas +4 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sales.bas +20 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sears.bas +18 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt1.bas +5 -0
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt2.bas +4 -0
- data/modules/emscripten/third_party/ply/example/GardenSnake/GardenSnake.py +709 -0
- data/modules/emscripten/third_party/ply/example/GardenSnake/README +5 -0
- data/modules/emscripten/third_party/ply/example/README +10 -0
- data/modules/emscripten/third_party/ply/example/ansic/README +2 -0
- data/modules/emscripten/third_party/ply/example/ansic/clex.py +164 -0
- data/modules/emscripten/third_party/ply/example/ansic/cparse.py +863 -0
- data/modules/emscripten/third_party/ply/example/calc/calc.py +107 -0
- data/modules/emscripten/third_party/ply/example/calcdebug/calc.py +113 -0
- data/modules/emscripten/third_party/ply/example/classcalc/calc.py +157 -0
- data/modules/emscripten/third_party/ply/example/cleanup.sh +2 -0
- data/modules/emscripten/third_party/ply/example/closurecalc/calc.py +130 -0
- data/modules/emscripten/third_party/ply/example/hedit/hedit.py +48 -0
- data/modules/emscripten/third_party/ply/example/newclasscalc/calc.py +160 -0
- data/modules/emscripten/third_party/ply/example/optcalc/README +9 -0
- data/modules/emscripten/third_party/ply/example/optcalc/calc.py +119 -0
- data/modules/emscripten/third_party/ply/example/unicalc/calc.py +117 -0
- data/modules/emscripten/third_party/ply/example/yply/README +41 -0
- data/modules/emscripten/third_party/ply/example/yply/ylex.py +112 -0
- data/modules/emscripten/third_party/ply/example/yply/yparse.py +217 -0
- data/modules/emscripten/third_party/ply/example/yply/yply.py +53 -0
- data/modules/emscripten/third_party/ply/ply/__init__.py +4 -0
- data/modules/emscripten/third_party/ply/ply/cpp.py +898 -0
- data/modules/emscripten/third_party/ply/ply/ctokens.py +133 -0
- data/modules/emscripten/third_party/ply/ply/lex.py +1058 -0
- data/modules/emscripten/third_party/ply/ply/yacc.py +3276 -0
- data/modules/emscripten/third_party/ply/setup.py +31 -0
- data/modules/emscripten/third_party/ply/test/README +7 -0
- data/modules/emscripten/third_party/ply/test/calclex.py +49 -0
- data/modules/emscripten/third_party/ply/test/cleanup.sh +4 -0
- data/modules/emscripten/third_party/ply/test/lex_closure.py +54 -0
- data/modules/emscripten/third_party/ply/test/lex_doc1.py +26 -0
- data/modules/emscripten/third_party/ply/test/lex_dup1.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_dup2.py +33 -0
- data/modules/emscripten/third_party/ply/test/lex_dup3.py +31 -0
- data/modules/emscripten/third_party/ply/test/lex_empty.py +20 -0
- data/modules/emscripten/third_party/ply/test/lex_error1.py +24 -0
- data/modules/emscripten/third_party/ply/test/lex_error2.py +26 -0
- data/modules/emscripten/third_party/ply/test/lex_error3.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_error4.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_hedit.py +47 -0
- data/modules/emscripten/third_party/ply/test/lex_ignore.py +31 -0
- data/modules/emscripten/third_party/ply/test/lex_ignore2.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_literal1.py +25 -0
- data/modules/emscripten/third_party/ply/test/lex_literal2.py +25 -0
- data/modules/emscripten/third_party/ply/test/lex_many_tokens.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_module.py +10 -0
- data/modules/emscripten/third_party/ply/test/lex_module_import.py +42 -0
- data/modules/emscripten/third_party/ply/test/lex_object.py +55 -0
- data/modules/emscripten/third_party/ply/test/lex_opt_alias.py +54 -0
- data/modules/emscripten/third_party/ply/test/lex_optimize.py +50 -0
- data/modules/emscripten/third_party/ply/test/lex_optimize2.py +50 -0
- data/modules/emscripten/third_party/ply/test/lex_optimize3.py +52 -0
- data/modules/emscripten/third_party/ply/test/lex_re1.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_re2.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_re3.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_rule1.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_rule2.py +29 -0
- data/modules/emscripten/third_party/ply/test/lex_rule3.py +27 -0
- data/modules/emscripten/third_party/ply/test/lex_state1.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state2.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state3.py +42 -0
- data/modules/emscripten/third_party/ply/test/lex_state4.py +41 -0
- data/modules/emscripten/third_party/ply/test/lex_state5.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state_noerror.py +39 -0
- data/modules/emscripten/third_party/ply/test/lex_state_norule.py +40 -0
- data/modules/emscripten/third_party/ply/test/lex_state_try.py +45 -0
- data/modules/emscripten/third_party/ply/test/lex_token1.py +19 -0
- data/modules/emscripten/third_party/ply/test/lex_token2.py +22 -0
- data/modules/emscripten/third_party/ply/test/lex_token3.py +24 -0
- data/modules/emscripten/third_party/ply/test/lex_token4.py +26 -0
- data/modules/emscripten/third_party/ply/test/lex_token5.py +31 -0
- data/modules/emscripten/third_party/ply/test/lex_token_dup.py +29 -0
- data/modules/emscripten/third_party/ply/test/testlex.py +606 -0
- data/modules/emscripten/third_party/ply/test/testyacc.py +347 -0
- data/modules/emscripten/third_party/ply/test/yacc_badargs.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badid.py +77 -0
- data/modules/emscripten/third_party/ply/test/yacc_badprec.py +64 -0
- data/modules/emscripten/third_party/ply/test/yacc_badprec2.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badprec3.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badrule.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_badtok.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_dup.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_error1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_error2.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_error3.py +67 -0
- data/modules/emscripten/third_party/ply/test/yacc_error4.py +72 -0
- data/modules/emscripten/third_party/ply/test/yacc_inf.py +56 -0
- data/modules/emscripten/third_party/ply/test/yacc_literal.py +69 -0
- data/modules/emscripten/third_party/ply/test/yacc_misplaced.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_missing1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_nested.py +33 -0
- data/modules/emscripten/third_party/ply/test/yacc_nodoc.py +67 -0
- data/modules/emscripten/third_party/ply/test/yacc_noerror.py +66 -0
- data/modules/emscripten/third_party/ply/test/yacc_nop.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_notfunc.py +66 -0
- data/modules/emscripten/third_party/ply/test/yacc_notok.py +67 -0
- data/modules/emscripten/third_party/ply/test/yacc_prec1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_rr.py +72 -0
- data/modules/emscripten/third_party/ply/test/yacc_rr_unused.py +30 -0
- data/modules/emscripten/third_party/ply/test/yacc_simple.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_sr.py +63 -0
- data/modules/emscripten/third_party/ply/test/yacc_term1.py +68 -0
- data/modules/emscripten/third_party/ply/test/yacc_unused.py +77 -0
- data/modules/emscripten/third_party/ply/test/yacc_unused_rule.py +72 -0
- data/modules/emscripten/third_party/ply/test/yacc_uprec.py +63 -0
- data/modules/emscripten/third_party/ply/test/yacc_uprec2.py +63 -0
- data/modules/emscripten/third_party/readme.txt +7 -0
- data/modules/emscripten/third_party/websockify/CHANGES.txt +23 -0
- data/modules/emscripten/third_party/websockify/LICENSE.txt +16 -0
- data/modules/emscripten/third_party/websockify/MANIFEST.in +1 -0
- data/modules/emscripten/third_party/websockify/Makefile +11 -0
- data/modules/emscripten/third_party/websockify/README.md +168 -0
- data/modules/emscripten/third_party/websockify/Windows/Windows Service Readme.txt +39 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Program.cs +24 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.Designer.cs +61 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.cs +19 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.resx +129 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Properties/AssemblyInfo.cs +36 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.Designer.cs +37 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.cs +41 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.csproj +75 -0
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.sln +20 -0
- data/modules/emscripten/third_party/websockify/docs/LICENSE.GPL-3 +621 -0
- data/modules/emscripten/third_party/websockify/docs/LICENSE.LGPL-3 +165 -0
- data/modules/emscripten/third_party/websockify/docs/LICENSE.MPL-2.0 +373 -0
- data/modules/emscripten/third_party/websockify/docs/TODO +9 -0
- data/modules/emscripten/third_party/websockify/docs/flash_policy.txt +4 -0
- data/modules/emscripten/third_party/websockify/docs/latency_results.txt +114 -0
- data/modules/emscripten/third_party/websockify/docs/notes +17 -0
- data/modules/emscripten/third_party/websockify/docs/release.txt +9 -0
- data/modules/emscripten/third_party/websockify/docs/websockify.1 +110 -0
- data/modules/emscripten/third_party/websockify/include/VT100.js +919 -0
- data/modules/emscripten/third_party/websockify/include/base64.js +114 -0
- data/modules/emscripten/third_party/websockify/include/keysym.js +99 -0
- data/modules/emscripten/third_party/websockify/include/util.js +359 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/README.txt +109 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/WebSocketMain.swf +0 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/swfobject.js +4 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/web_socket.js +391 -0
- data/modules/emscripten/third_party/websockify/include/websock.js +422 -0
- data/modules/emscripten/third_party/websockify/include/webutil.js +216 -0
- data/modules/emscripten/third_party/websockify/include/wsirc.js +235 -0
- data/modules/emscripten/third_party/websockify/include/wstelnet.js +335 -0
- data/modules/emscripten/third_party/websockify/other/Makefile +14 -0
- data/modules/emscripten/third_party/websockify/other/README.md +51 -0
- data/modules/emscripten/third_party/websockify/other/launch.sh +108 -0
- data/modules/emscripten/third_party/websockify/other/project.clj +13 -0
- data/modules/emscripten/third_party/websockify/other/websocket.c +802 -0
- data/modules/emscripten/third_party/websockify/other/websocket.h +84 -0
- data/modules/emscripten/third_party/websockify/other/websocket.rb +456 -0
- data/modules/emscripten/third_party/websockify/other/websockify.c +385 -0
- data/modules/emscripten/third_party/websockify/other/websockify.clj +233 -0
- data/modules/emscripten/third_party/websockify/other/websockify.js +196 -0
- data/modules/emscripten/third_party/websockify/other/websockify.rb +171 -0
- data/modules/emscripten/third_party/websockify/other/wswrap +22 -0
- data/modules/emscripten/third_party/websockify/rebind +18 -0
- data/modules/emscripten/third_party/websockify/rebind.c +94 -0
- data/modules/emscripten/third_party/websockify/run +5 -0
- data/modules/emscripten/third_party/websockify/setup.py +30 -0
- data/modules/emscripten/third_party/websockify/tests/b64_vs_utf8.py +29 -0
- data/modules/emscripten/third_party/websockify/tests/base64.html +91 -0
- data/modules/emscripten/third_party/websockify/tests/base64.js +12 -0
- data/modules/emscripten/third_party/websockify/tests/echo.html +148 -0
- data/modules/emscripten/third_party/websockify/tests/echo.py +75 -0
- data/modules/emscripten/third_party/websockify/tests/echo.rb +62 -0
- data/modules/emscripten/third_party/websockify/tests/latency.html +290 -0
- data/modules/emscripten/third_party/websockify/tests/latency.py +75 -0
- data/modules/emscripten/third_party/websockify/tests/load.html +250 -0
- data/modules/emscripten/third_party/websockify/tests/load.py +167 -0
- data/modules/emscripten/third_party/websockify/tests/plain_echo.html +168 -0
- data/modules/emscripten/third_party/websockify/tests/simple.html +68 -0
- data/modules/emscripten/third_party/websockify/tests/utf8-list.py +22 -0
- data/modules/emscripten/third_party/websockify/websockify/__init__.py +2 -0
- data/modules/emscripten/third_party/websockify/websockify/websocket.py +982 -0
- data/modules/emscripten/third_party/websockify/websockify/websocketproxy.py +393 -0
- data/modules/emscripten/third_party/websockify/websockify.py +5 -0
- data/modules/emscripten/third_party/websockify/wsirc.html +99 -0
- data/modules/emscripten/third_party/websockify/wstelnet.html +74 -0
- data/modules/emscripten/tools/__init__.py +0 -0
- data/modules/emscripten/tools/__init__.pyc +0 -0
- data/modules/emscripten/tools/autodebugger.py +289 -0
- data/modules/emscripten/tools/autodebugger_c.py +37 -0
- data/modules/emscripten/tools/autodebugger_indenter.py +18 -0
- data/modules/emscripten/tools/autodebugger_js.py +47 -0
- data/modules/emscripten/tools/autodediffer.py +60 -0
- data/modules/emscripten/tools/bindings_generator.py +832 -0
- data/modules/emscripten/tools/bisect_pair.py +88 -0
- data/modules/emscripten/tools/cache.py +198 -0
- data/modules/emscripten/tools/cache.pyc +0 -0
- data/modules/emscripten/tools/clean_webconsole.py +34 -0
- data/modules/emscripten/tools/crunch-worker.js +124 -0
- data/modules/emscripten/tools/diff_autodebugger.py +15 -0
- data/modules/emscripten/tools/eliminator/asm-eliminator-test-output.js +5129 -0
- data/modules/emscripten/tools/eliminator/asm-eliminator-test.js +6861 -0
- data/modules/emscripten/tools/eliminator/eliminator-test-output.js +6122 -0
- data/modules/emscripten/tools/eliminator/eliminator-test.js +8856 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.html +888 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.org +463 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/bin/uglifyjs +317 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/docstyle.css +75 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/object-ast.js +75 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/parse-js.js +1363 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/process.js +2005 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/squeeze-more.js +51 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/package.json +22 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/beautify.js +28 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/testparser.js +402 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array1.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array2.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array3.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array4.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/assignment.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/concatstring.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/const.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/forstatement.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/if.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue10.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue11.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue13.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue14.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue16.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue17.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue20.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue21.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue25.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue27.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue28.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue29.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue30.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue34.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue4.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue48.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue50.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue53.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue68.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue69.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue9.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/mangle.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/var.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/with.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array1.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array2.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array3.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array4.js +6 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/assignment.js +20 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/concatstring.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/const.js +5 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/forstatement.js +10 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/if.js +6 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn.js +9 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js +16 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue10.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue11.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue13.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue14.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue16.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue17.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue20.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue21.js +6 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue25.js +7 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue27.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue28.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue29.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue30.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue34.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue4.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue48.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue50.js +9 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue53.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue68.js +5 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue69.js +1 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue9.js +4 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/mangle.js +5 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/var.js +3 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/with.js +2 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/scripts.js +55 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/hoist.js +33 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument.js +97 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument2.js +138 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/test.js +16 -0
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/uglify-js.js +17 -0
- data/modules/emscripten/tools/eliminator/safe-eliminator-test-output.js +85 -0
- data/modules/emscripten/tools/eliminator/safe-eliminator-test.js +103 -0
- data/modules/emscripten/tools/emconfiguren.py +19 -0
- data/modules/emscripten/tools/emmaken.py +230 -0
- data/modules/emscripten/tools/emmakenxx.py +18 -0
- data/modules/emscripten/tools/exec_llvm.py +50 -0
- data/modules/emscripten/tools/file2json.py +49 -0
- data/modules/emscripten/tools/file_packager.py +649 -0
- data/modules/emscripten/tools/find_bigfuncs.py +23 -0
- data/modules/emscripten/tools/find_bigis.py +18 -0
- data/modules/emscripten/tools/fix_closure.py +88 -0
- data/modules/emscripten/tools/ie7_fix.py +14 -0
- data/modules/emscripten/tools/js-optimizer.js +3440 -0
- data/modules/emscripten/tools/js_optimizer.py +341 -0
- data/modules/emscripten/tools/js_optimizer.pyc +0 -0
- data/modules/emscripten/tools/jsrun.py +27 -0
- data/modules/emscripten/tools/jsrun.pyc +0 -0
- data/modules/emscripten/tools/ll-strip.py +56 -0
- data/modules/emscripten/tools/make_file.py +19 -0
- data/modules/emscripten/tools/make_minigzip.py +13 -0
- data/modules/emscripten/tools/namespacer.py +95 -0
- data/modules/emscripten/tools/nativize_llvm.py +34 -0
- data/modules/emscripten/tools/node_modules/source-map/CHANGELOG.md +58 -0
- data/modules/emscripten/tools/node_modules/source-map/LICENSE +28 -0
- data/modules/emscripten/tools/node_modules/source-map/Makefile.dryice.js +166 -0
- data/modules/emscripten/tools/node_modules/source-map/README.md +347 -0
- data/modules/emscripten/tools/node_modules/source-map/build/assert-shim.js +56 -0
- data/modules/emscripten/tools/node_modules/source-map/build/mini-require.js +152 -0
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-source-map.jsm +20 -0
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-utils.jsm +18 -0
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-browser.js +8 -0
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-source-map.jsm +6 -0
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-utils.jsm +21 -0
- data/modules/emscripten/tools/node_modules/source-map/build/test-prefix.js +8 -0
- data/modules/emscripten/tools/node_modules/source-map/build/test-suffix.js +3 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/array-set.js +96 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64.js +42 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/binary-search.js +81 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-consumer.js +430 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-generator.js +381 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-node.js +353 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/util.js +117 -0
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map.js +8 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/README.md +119 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/package.json +33 -0
- data/modules/emscripten/tools/node_modules/source-map/package.json +74 -0
- data/modules/emscripten/tools/node_modules/source-map/test/run-tests.js +73 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-api.js +26 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-array-set.js +71 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64.js +35 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-consumer.js +306 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-generator.js +391 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-node.js +282 -0
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/util.js +152 -0
- data/modules/emscripten/tools/reproduceriter.js +216 -0
- data/modules/emscripten/tools/reproduceriter.py +160 -0
- data/modules/emscripten/tools/response_file.py +28 -0
- data/modules/emscripten/tools/response_file.pyc +0 -0
- data/modules/emscripten/tools/scan_js.py +20 -0
- data/modules/emscripten/tools/scan_ll.py +18 -0
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/__init__.py +3 -0
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/emscripten.py +46 -0
- data/modules/emscripten/tools/settings_template_readonly.py +47 -0
- data/modules/emscripten/tools/shared.py +1437 -0
- data/modules/emscripten/tools/shared.pyc +0 -0
- data/modules/emscripten/tools/source-maps/sourcemap2json.js +15 -0
- data/modules/emscripten/tools/source-maps/sourcemapper.js +177 -0
- data/modules/emscripten/tools/split.py +97 -0
- data/modules/emscripten/tools/tempfiles.py +40 -0
- data/modules/emscripten/tools/tempfiles.pyc +0 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-last-output.js +75 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-last.js +91 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-outline-output.js +570 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-outline.js +606 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-pre-output.js +540 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-pre.js +550 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min-output.js +36 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min.js +37 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-output.js +106 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-regs.js +110 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate-output.js +9 -0
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate.js +12 -0
- data/modules/emscripten/tools/test-js-optimizer-output.js +291 -0
- data/modules/emscripten/tools/test-js-optimizer-regs-output.js +232 -0
- data/modules/emscripten/tools/test-js-optimizer-regs.js +237 -0
- data/modules/emscripten/tools/test-js-optimizer-t2-output.js +91 -0
- data/modules/emscripten/tools/test-js-optimizer-t2.js +92 -0
- data/modules/emscripten/tools/test-js-optimizer-t2c-output.js +17 -0
- data/modules/emscripten/tools/test-js-optimizer-t2c.js +18 -0
- data/modules/emscripten/tools/test-js-optimizer-t3-output.js +49 -0
- data/modules/emscripten/tools/test-js-optimizer-t3.js +50 -0
- data/modules/emscripten/tools/test-js-optimizer.js +401 -0
- data/modules/mruby/AUTHORS +18 -0
- data/modules/mruby/CONTRIBUTING.md +65 -0
- data/modules/mruby/ChangeLog +15 -0
- data/modules/mruby/INSTALL +29 -0
- data/modules/mruby/LEGAL +6 -0
- data/modules/mruby/MITL +20 -0
- data/modules/mruby/Makefile +18 -0
- data/modules/mruby/NEWS +13 -0
- data/modules/mruby/README.md +116 -0
- data/modules/mruby/Rakefile +114 -0
- data/modules/mruby/TODO +11 -0
- data/modules/mruby/benchmark/ao-render.rb +315 -0
- data/modules/mruby/benchmark/bm_so_lists.rb +47 -0
- data/modules/mruby/benchmark/fib39.rb +8 -0
- data/modules/mruby/build_config.rb +88 -0
- data/modules/mruby/doc/compile/README.md +376 -0
- data/modules/mruby/doc/mrbgems/README.md +254 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/README.md +4 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake +23 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb +5 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c +20 -0
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/test/example.rb +7 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/README.md +4 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/mrbgem.rake +23 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/src/example.c +20 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/test/example.c +7 -0
- data/modules/mruby/examples/mrbgems/c_extension_example/test/example.rb +3 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/README.md +4 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake +23 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb +5 -0
- data/modules/mruby/examples/mrbgems/ruby_extension_example/test/example.rb +3 -0
- data/modules/mruby/examples/targets/ArduinoDue.rb +65 -0
- data/modules/mruby/examples/targets/chipKitMax32.rb +68 -0
- data/modules/mruby/include/mrbconf.h +87 -0
- data/modules/mruby/include/mruby/array.h +63 -0
- data/modules/mruby/include/mruby/class.h +75 -0
- data/modules/mruby/include/mruby/compile.h +176 -0
- data/modules/mruby/include/mruby/data.h +53 -0
- data/modules/mruby/include/mruby/dump.h +151 -0
- data/modules/mruby/include/mruby/gc.h +17 -0
- data/modules/mruby/include/mruby/hash.h +54 -0
- data/modules/mruby/include/mruby/irep.h +40 -0
- data/modules/mruby/include/mruby/khash.h +257 -0
- data/modules/mruby/include/mruby/numeric.h +32 -0
- data/modules/mruby/include/mruby/proc.h +62 -0
- data/modules/mruby/include/mruby/range.h +35 -0
- data/modules/mruby/include/mruby/string.h +78 -0
- data/modules/mruby/include/mruby/value.h +483 -0
- data/modules/mruby/include/mruby/variable.h +78 -0
- data/modules/mruby/include/mruby.h +388 -0
- data/modules/mruby/minirake +477 -0
- data/modules/mruby/mrbgems/default.gembox +61 -0
- data/modules/mruby/mrbgems/full-core.gembox +9 -0
- data/modules/mruby/mrbgems/mruby-array-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +204 -0
- data/modules/mruby/mrbgems/mruby-array-ext/src/array.c +140 -0
- data/modules/mruby/mrbgems/mruby-array-ext/test/array.rb +109 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/mrbgem.rake +5 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +365 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +5 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +243 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +164 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/test/enum.rb +44 -0
- data/modules/mruby/mrbgems/mruby-eval/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-eval/src/eval.c +23 -0
- data/modules/mruby/mrbgems/mruby-fiber/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-fiber/src/fiber.c +251 -0
- data/modules/mruby/mrbgems/mruby-fiber/test/fiber.rb +64 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +13 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +62 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/test/hash.rb +26 -0
- data/modules/mruby/mrbgems/mruby-math/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-math/src/math.c +685 -0
- data/modules/mruby/mrbgems/mruby-math/test/math.rb +136 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +31 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +10 -0
- data/modules/mruby/mrbgems/mruby-object-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-object-ext/src/object.c +108 -0
- data/modules/mruby/mrbgems/mruby-object-ext/test/nil.rb +11 -0
- data/modules/mruby/mrbgems/mruby-object-ext/test/object.rb +9 -0
- data/modules/mruby/mrbgems/mruby-objectspace/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +117 -0
- data/modules/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +38 -0
- data/modules/mruby/mrbgems/mruby-print/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-print/mrblib/print.rb +64 -0
- data/modules/mruby/mrbgems/mruby-print/src/print.c +44 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/mrblib/proc.rb +40 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/src/proc.c +97 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/test/proc.rb +41 -0
- data/modules/mruby/mrbgems/mruby-random/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.c +193 -0
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.h +48 -0
- data/modules/mruby/mrbgems/mruby-random/src/random.c +231 -0
- data/modules/mruby/mrbgems/mruby-random/src/random.h +12 -0
- data/modules/mruby/mrbgems/mruby-random/test/random.rb +32 -0
- data/modules/mruby/mrbgems/mruby-range-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-range-ext/src/range.c +141 -0
- data/modules/mruby/mrbgems/mruby-range-ext/test/range.rb +20 -0
- data/modules/mruby/mrbgems/mruby-sprintf/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-sprintf/src/kernel.c +30 -0
- data/modules/mruby/mrbgems/mruby-sprintf/src/sprintf.c +1102 -0
- data/modules/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +3 -0
- data/modules/mruby/mrbgems/mruby-string-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +52 -0
- data/modules/mruby/mrbgems/mruby-string-ext/src/string.c +175 -0
- data/modules/mruby/mrbgems/mruby-string-ext/test/string.rb +112 -0
- data/modules/mruby/mrbgems/mruby-struct/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-struct/mrblib/struct.rb +50 -0
- data/modules/mruby/mrbgems/mruby-struct/src/struct.c +818 -0
- data/modules/mruby/mrbgems/mruby-struct/test/struct.rb +77 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +9 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +55 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +12 -0
- data/modules/mruby/mrbgems/mruby-time/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-time/src/time.c +749 -0
- data/modules/mruby/mrbgems/mruby-time/test/time.rb +201 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/mrbgem.rake +4 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb +11 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/test/toplevel.rb +24 -0
- data/modules/mruby/mrblib/array.rb +111 -0
- data/modules/mruby/mrblib/class.rb +26 -0
- data/modules/mruby/mrblib/compar.rb +104 -0
- data/modules/mruby/mrblib/enum.rb +398 -0
- data/modules/mruby/mrblib/error.rb +66 -0
- data/modules/mruby/mrblib/hash.rb +193 -0
- data/modules/mruby/mrblib/init_mrblib.c +14 -0
- data/modules/mruby/mrblib/kernel.rb +46 -0
- data/modules/mruby/mrblib/mrblib.rake +18 -0
- data/modules/mruby/mrblib/numeric.rb +101 -0
- data/modules/mruby/mrblib/print.rb +18 -0
- data/modules/mruby/mrblib/range.rb +40 -0
- data/modules/mruby/mrblib/string.rb +145 -0
- data/modules/mruby/src/array.c +1150 -0
- data/modules/mruby/src/backtrace.c +73 -0
- data/modules/mruby/src/class.c +1942 -0
- data/modules/mruby/src/codegen.c +2864 -0
- data/modules/mruby/src/compar.c +13 -0
- data/modules/mruby/src/crc.c +38 -0
- data/modules/mruby/src/dump.c +542 -0
- data/modules/mruby/src/enum.c +14 -0
- data/modules/mruby/src/error.c +454 -0
- data/modules/mruby/src/error.h +18 -0
- data/modules/mruby/src/etc.c +204 -0
- data/modules/mruby/src/gc.c +1542 -0
- data/modules/mruby/src/hash.c +1261 -0
- data/modules/mruby/src/init.c +62 -0
- data/modules/mruby/src/kernel.c +1105 -0
- data/modules/mruby/src/keywords +50 -0
- data/modules/mruby/src/lex.def +212 -0
- data/modules/mruby/src/load.c +629 -0
- data/modules/mruby/src/mruby_core.rake +28 -0
- data/modules/mruby/src/node.h +117 -0
- data/modules/mruby/src/numeric.c +1418 -0
- data/modules/mruby/src/object.c +593 -0
- data/modules/mruby/src/opcode.h +160 -0
- data/modules/mruby/src/parse.y +6050 -0
- data/modules/mruby/src/pool.c +190 -0
- data/modules/mruby/src/print.c +71 -0
- data/modules/mruby/src/proc.c +209 -0
- data/modules/mruby/src/range.c +442 -0
- data/modules/mruby/src/re.h +13 -0
- data/modules/mruby/src/state.c +200 -0
- data/modules/mruby/src/string.c +2580 -0
- data/modules/mruby/src/symbol.c +456 -0
- data/modules/mruby/src/value_array.h +27 -0
- data/modules/mruby/src/variable.c +1147 -0
- data/modules/mruby/src/vm.c +2129 -0
- data/modules/mruby/tasks/libmruby.rake +18 -0
- data/modules/mruby/tasks/mrbgem_spec.rake +297 -0
- data/modules/mruby/tasks/mrbgems.rake +85 -0
- data/modules/mruby/tasks/mrbgems_test.rake +88 -0
- data/modules/mruby/tasks/mruby_build.rake +211 -0
- data/modules/mruby/tasks/mruby_build_commands.rake +287 -0
- data/modules/mruby/tasks/mruby_build_gem.rake +67 -0
- data/modules/mruby/tasks/ruby_ext.rake +70 -0
- data/modules/mruby/tasks/toolchains/androideabi.rake +126 -0
- data/modules/mruby/tasks/toolchains/clang.rake +8 -0
- data/modules/mruby/tasks/toolchains/gcc.rake +21 -0
- data/modules/mruby/tasks/toolchains/vs2010.rake +3 -0
- data/modules/mruby/tasks/toolchains/vs2012.rake +44 -0
- data/modules/mruby/test/README.md +7 -0
- data/modules/mruby/test/assert.rb +238 -0
- data/modules/mruby/test/driver.c +118 -0
- data/modules/mruby/test/init_mrbtest.c +24 -0
- data/modules/mruby/test/mrbtest.rake +47 -0
- data/modules/mruby/test/report.rb +4 -0
- data/modules/mruby/test/t/argumenterror.rb +21 -0
- data/modules/mruby/test/t/array.rb +309 -0
- data/modules/mruby/test/t/basicobject.rb +11 -0
- data/modules/mruby/test/t/bs_block.rb +489 -0
- data/modules/mruby/test/t/bs_literal.rb +38 -0
- data/modules/mruby/test/t/class.rb +219 -0
- data/modules/mruby/test/t/comparable.rb +72 -0
- data/modules/mruby/test/t/enumerable.rb +108 -0
- data/modules/mruby/test/t/exception.rb +337 -0
- data/modules/mruby/test/t/false.rb +33 -0
- data/modules/mruby/test/t/float.rb +145 -0
- data/modules/mruby/test/t/gc.rb +45 -0
- data/modules/mruby/test/t/hash.rb +310 -0
- data/modules/mruby/test/t/indexerror.rb +10 -0
- data/modules/mruby/test/t/integer.rb +222 -0
- data/modules/mruby/test/t/kernel.rb +425 -0
- data/modules/mruby/test/t/literals.rb +287 -0
- data/modules/mruby/test/t/localjumperror.rb +13 -0
- data/modules/mruby/test/t/methods.rb +109 -0
- data/modules/mruby/test/t/module.rb +344 -0
- data/modules/mruby/test/t/nameerror.rb +32 -0
- data/modules/mruby/test/t/nil.rb +29 -0
- data/modules/mruby/test/t/nomethoderror.rb +13 -0
- data/modules/mruby/test/t/numeric.rb +29 -0
- data/modules/mruby/test/t/object.rb +11 -0
- data/modules/mruby/test/t/proc.rb +56 -0
- data/modules/mruby/test/t/range.rb +82 -0
- data/modules/mruby/test/t/rangeerror.rb +10 -0
- data/modules/mruby/test/t/regexperror.rb +4 -0
- data/modules/mruby/test/t/runtimeerror.rb +6 -0
- data/modules/mruby/test/t/standarderror.rb +10 -0
- data/modules/mruby/test/t/string.rb +483 -0
- data/modules/mruby/test/t/symbol.rb +27 -0
- data/modules/mruby/test/t/syntax.rb +67 -0
- data/modules/mruby/test/t/true.rb +33 -0
- data/modules/mruby/test/t/typeerror.rb +11 -0
- data/modules/mruby/tools/mrbc/mrbc.c +318 -0
- data/modules/mruby/tools/mrbc/mrbc.rake +14 -0
- data/modules/mruby/travis_config.rb +6 -0
- data/modules/mrubymix/LICENSE +21 -0
- data/modules/mrubymix/README.md +6 -0
- data/modules/mrubymix/bin/mrubymix +29 -0
- data/modules/mrubymix/lib/mrubymix.rb +93 -0
- data/modules/mrubymix/mrubymix.gemspec +13 -0
- data/scripts/gen_gems_config.rb +185 -0
- data/scripts/gen_post.rb +104 -0
- data/templates/minimal/Rakefile +36 -0
- data/templates/minimal/app/app.rb +3 -0
- metadata +1408 -0
@@ -0,0 +1,2275 @@
|
|
1
|
+
// -*- C++ -*-
|
2
|
+
//===---------------------------- list ------------------------------------===//
|
3
|
+
//
|
4
|
+
// The LLVM Compiler Infrastructure
|
5
|
+
//
|
6
|
+
// This file is dual licensed under the MIT and the University of Illinois Open
|
7
|
+
// Source Licenses. See LICENSE.TXT for details.
|
8
|
+
//
|
9
|
+
//===----------------------------------------------------------------------===//
|
10
|
+
|
11
|
+
#ifndef _LIBCPP_LIST
|
12
|
+
#define _LIBCPP_LIST
|
13
|
+
|
14
|
+
/*
|
15
|
+
list synopsis
|
16
|
+
|
17
|
+
namespace std
|
18
|
+
{
|
19
|
+
|
20
|
+
template <class T, class Alloc = allocator<T> >
|
21
|
+
class list
|
22
|
+
{
|
23
|
+
public:
|
24
|
+
|
25
|
+
// types:
|
26
|
+
typedef T value_type;
|
27
|
+
typedef Alloc allocator_type;
|
28
|
+
typedef typename allocator_type::reference reference;
|
29
|
+
typedef typename allocator_type::const_reference const_reference;
|
30
|
+
typedef typename allocator_type::pointer pointer;
|
31
|
+
typedef typename allocator_type::const_pointer const_pointer;
|
32
|
+
typedef implementation-defined iterator;
|
33
|
+
typedef implementation-defined const_iterator;
|
34
|
+
typedef implementation-defined size_type;
|
35
|
+
typedef implementation-defined difference_type;
|
36
|
+
typedef reverse_iterator<iterator> reverse_iterator;
|
37
|
+
typedef reverse_iterator<const_iterator> const_reverse_iterator;
|
38
|
+
|
39
|
+
list()
|
40
|
+
noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
41
|
+
explicit list(const allocator_type& a);
|
42
|
+
explicit list(size_type n);
|
43
|
+
list(size_type n, const value_type& value);
|
44
|
+
list(size_type n, const value_type& value, const allocator_type& a);
|
45
|
+
template <class Iter>
|
46
|
+
list(Iter first, Iter last);
|
47
|
+
template <class Iter>
|
48
|
+
list(Iter first, Iter last, const allocator_type& a);
|
49
|
+
list(const list& x);
|
50
|
+
list(const list&, const allocator_type& a);
|
51
|
+
list(list&& x)
|
52
|
+
noexcept(is_nothrow_move_constructible<allocator_type>::value);
|
53
|
+
list(list&&, const allocator_type& a);
|
54
|
+
list(initializer_list<value_type>);
|
55
|
+
list(initializer_list<value_type>, const allocator_type& a);
|
56
|
+
|
57
|
+
~list();
|
58
|
+
|
59
|
+
list& operator=(const list& x);
|
60
|
+
list& operator=(list&& x)
|
61
|
+
noexcept(
|
62
|
+
allocator_type::propagate_on_container_move_assignment::value &&
|
63
|
+
is_nothrow_move_assignable<allocator_type>::value);
|
64
|
+
list& operator=(initializer_list<value_type>);
|
65
|
+
template <class Iter>
|
66
|
+
void assign(Iter first, Iter last);
|
67
|
+
void assign(size_type n, const value_type& t);
|
68
|
+
void assign(initializer_list<value_type>);
|
69
|
+
|
70
|
+
allocator_type get_allocator() const noexcept;
|
71
|
+
|
72
|
+
iterator begin() noexcept;
|
73
|
+
const_iterator begin() const noexcept;
|
74
|
+
iterator end() noexcept;
|
75
|
+
const_iterator end() const noexcept;
|
76
|
+
reverse_iterator rbegin() noexcept;
|
77
|
+
const_reverse_iterator rbegin() const noexcept;
|
78
|
+
reverse_iterator rend() noexcept;
|
79
|
+
const_reverse_iterator rend() const noexcept;
|
80
|
+
const_iterator cbegin() const noexcept;
|
81
|
+
const_iterator cend() const noexcept;
|
82
|
+
const_reverse_iterator crbegin() const noexcept;
|
83
|
+
const_reverse_iterator crend() const noexcept;
|
84
|
+
|
85
|
+
reference front();
|
86
|
+
const_reference front() const;
|
87
|
+
reference back();
|
88
|
+
const_reference back() const;
|
89
|
+
|
90
|
+
bool empty() const noexcept;
|
91
|
+
size_type size() const noexcept;
|
92
|
+
size_type max_size() const noexcept;
|
93
|
+
|
94
|
+
template <class... Args>
|
95
|
+
void emplace_front(Args&&... args);
|
96
|
+
void pop_front();
|
97
|
+
template <class... Args>
|
98
|
+
void emplace_back(Args&&... args);
|
99
|
+
void pop_back();
|
100
|
+
void push_front(const value_type& x);
|
101
|
+
void push_front(value_type&& x);
|
102
|
+
void push_back(const value_type& x);
|
103
|
+
void push_back(value_type&& x);
|
104
|
+
template <class... Args>
|
105
|
+
iterator emplace(const_iterator position, Args&&... args);
|
106
|
+
iterator insert(const_iterator position, const value_type& x);
|
107
|
+
iterator insert(const_iterator position, value_type&& x);
|
108
|
+
iterator insert(const_iterator position, size_type n, const value_type& x);
|
109
|
+
template <class Iter>
|
110
|
+
iterator insert(const_iterator position, Iter first, Iter last);
|
111
|
+
iterator insert(const_iterator position, initializer_list<value_type> il);
|
112
|
+
|
113
|
+
iterator erase(const_iterator position);
|
114
|
+
iterator erase(const_iterator position, const_iterator last);
|
115
|
+
|
116
|
+
void resize(size_type sz);
|
117
|
+
void resize(size_type sz, const value_type& c);
|
118
|
+
|
119
|
+
void swap(list&)
|
120
|
+
noexcept(!allocator_type::propagate_on_container_swap::value ||
|
121
|
+
__is_nothrow_swappable<allocator_type>::value);
|
122
|
+
void clear() noexcept;
|
123
|
+
|
124
|
+
void splice(const_iterator position, list& x);
|
125
|
+
void splice(const_iterator position, list&& x);
|
126
|
+
void splice(const_iterator position, list& x, const_iterator i);
|
127
|
+
void splice(const_iterator position, list&& x, const_iterator i);
|
128
|
+
void splice(const_iterator position, list& x, const_iterator first,
|
129
|
+
const_iterator last);
|
130
|
+
void splice(const_iterator position, list&& x, const_iterator first,
|
131
|
+
const_iterator last);
|
132
|
+
|
133
|
+
void remove(const value_type& value);
|
134
|
+
template <class Pred> void remove_if(Pred pred);
|
135
|
+
void unique();
|
136
|
+
template <class BinaryPredicate>
|
137
|
+
void unique(BinaryPredicate binary_pred);
|
138
|
+
void merge(list& x);
|
139
|
+
void merge(list&& x);
|
140
|
+
template <class Compare>
|
141
|
+
void merge(list& x, Compare comp);
|
142
|
+
template <class Compare>
|
143
|
+
void merge(list&& x, Compare comp);
|
144
|
+
void sort();
|
145
|
+
template <class Compare>
|
146
|
+
void sort(Compare comp);
|
147
|
+
void reverse() noexcept;
|
148
|
+
};
|
149
|
+
|
150
|
+
template <class T, class Alloc>
|
151
|
+
bool operator==(const list<T,Alloc>& x, const list<T,Alloc>& y);
|
152
|
+
template <class T, class Alloc>
|
153
|
+
bool operator< (const list<T,Alloc>& x, const list<T,Alloc>& y);
|
154
|
+
template <class T, class Alloc>
|
155
|
+
bool operator!=(const list<T,Alloc>& x, const list<T,Alloc>& y);
|
156
|
+
template <class T, class Alloc>
|
157
|
+
bool operator> (const list<T,Alloc>& x, const list<T,Alloc>& y);
|
158
|
+
template <class T, class Alloc>
|
159
|
+
bool operator>=(const list<T,Alloc>& x, const list<T,Alloc>& y);
|
160
|
+
template <class T, class Alloc>
|
161
|
+
bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y);
|
162
|
+
|
163
|
+
template <class T, class Alloc>
|
164
|
+
void swap(list<T,Alloc>& x, list<T,Alloc>& y)
|
165
|
+
noexcept(noexcept(x.swap(y)));
|
166
|
+
|
167
|
+
} // std
|
168
|
+
|
169
|
+
*/
|
170
|
+
|
171
|
+
#include <__config>
|
172
|
+
|
173
|
+
#include <memory>
|
174
|
+
#include <limits>
|
175
|
+
#include <initializer_list>
|
176
|
+
#include <iterator>
|
177
|
+
#include <algorithm>
|
178
|
+
|
179
|
+
#include <__undef_min_max>
|
180
|
+
|
181
|
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
182
|
+
#pragma GCC system_header
|
183
|
+
#endif
|
184
|
+
|
185
|
+
_LIBCPP_BEGIN_NAMESPACE_STD
|
186
|
+
|
187
|
+
template <class _Tp, class _VoidPtr> struct __list_node;
|
188
|
+
|
189
|
+
template <class _Tp, class _VoidPtr>
|
190
|
+
struct __list_node_base
|
191
|
+
{
|
192
|
+
typedef typename pointer_traits<_VoidPtr>::template
|
193
|
+
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
194
|
+
rebind<__list_node<_Tp, _VoidPtr> > pointer;
|
195
|
+
#else
|
196
|
+
rebind<__list_node<_Tp, _VoidPtr> >::other pointer;
|
197
|
+
#endif
|
198
|
+
|
199
|
+
pointer __prev_;
|
200
|
+
pointer __next_;
|
201
|
+
|
202
|
+
_LIBCPP_INLINE_VISIBILITY
|
203
|
+
__list_node_base()
|
204
|
+
: __prev_(static_cast<pointer>(this)),
|
205
|
+
__next_(static_cast<pointer>(this))
|
206
|
+
{}
|
207
|
+
};
|
208
|
+
|
209
|
+
template <class _Tp, class _VoidPtr>
|
210
|
+
struct __list_node
|
211
|
+
: public __list_node_base<_Tp, _VoidPtr>
|
212
|
+
{
|
213
|
+
_Tp __value_;
|
214
|
+
};
|
215
|
+
|
216
|
+
template <class _Tp, class _Alloc> class _LIBCPP_TYPE_VIS list;
|
217
|
+
template <class _Tp, class _Alloc> class __list_imp;
|
218
|
+
template <class _Tp, class _VoidPtr> class _LIBCPP_TYPE_VIS __list_const_iterator;
|
219
|
+
|
220
|
+
template <class _Tp, class _VoidPtr>
|
221
|
+
class _LIBCPP_TYPE_VIS __list_iterator
|
222
|
+
{
|
223
|
+
typedef typename pointer_traits<_VoidPtr>::template
|
224
|
+
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
225
|
+
rebind<__list_node<_Tp, _VoidPtr> > __node_pointer;
|
226
|
+
#else
|
227
|
+
rebind<__list_node<_Tp, _VoidPtr> >::other __node_pointer;
|
228
|
+
#endif
|
229
|
+
|
230
|
+
__node_pointer __ptr_;
|
231
|
+
|
232
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
233
|
+
_LIBCPP_INLINE_VISIBILITY
|
234
|
+
explicit __list_iterator(__node_pointer __p, const void* __c) _NOEXCEPT
|
235
|
+
: __ptr_(__p)
|
236
|
+
{
|
237
|
+
__get_db()->__insert_ic(this, __c);
|
238
|
+
}
|
239
|
+
#else
|
240
|
+
_LIBCPP_INLINE_VISIBILITY
|
241
|
+
explicit __list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
242
|
+
#endif
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
template<class, class> friend class list;
|
247
|
+
template<class, class> friend class __list_imp;
|
248
|
+
template<class, class> friend class __list_const_iterator;
|
249
|
+
public:
|
250
|
+
typedef bidirectional_iterator_tag iterator_category;
|
251
|
+
typedef _Tp value_type;
|
252
|
+
typedef value_type& reference;
|
253
|
+
typedef typename pointer_traits<_VoidPtr>::template
|
254
|
+
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
255
|
+
rebind<value_type>
|
256
|
+
#else
|
257
|
+
rebind<value_type>::other
|
258
|
+
#endif
|
259
|
+
pointer;
|
260
|
+
typedef typename pointer_traits<pointer>::difference_type difference_type;
|
261
|
+
|
262
|
+
_LIBCPP_INLINE_VISIBILITY
|
263
|
+
__list_iterator() _NOEXCEPT
|
264
|
+
{
|
265
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
266
|
+
__get_db()->__insert_i(this);
|
267
|
+
#endif
|
268
|
+
}
|
269
|
+
|
270
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
271
|
+
|
272
|
+
_LIBCPP_INLINE_VISIBILITY
|
273
|
+
__list_iterator(const __list_iterator& __p)
|
274
|
+
: __ptr_(__p.__ptr_)
|
275
|
+
{
|
276
|
+
__get_db()->__iterator_copy(this, &__p);
|
277
|
+
}
|
278
|
+
|
279
|
+
_LIBCPP_INLINE_VISIBILITY
|
280
|
+
~__list_iterator()
|
281
|
+
{
|
282
|
+
__get_db()->__erase_i(this);
|
283
|
+
}
|
284
|
+
|
285
|
+
_LIBCPP_INLINE_VISIBILITY
|
286
|
+
__list_iterator& operator=(const __list_iterator& __p)
|
287
|
+
{
|
288
|
+
if (this != &__p)
|
289
|
+
{
|
290
|
+
__get_db()->__iterator_copy(this, &__p);
|
291
|
+
__ptr_ = __p.__ptr_;
|
292
|
+
}
|
293
|
+
return *this;
|
294
|
+
}
|
295
|
+
|
296
|
+
#endif // _LIBCPP_DEBUG_LEVEL >= 2
|
297
|
+
|
298
|
+
_LIBCPP_INLINE_VISIBILITY
|
299
|
+
reference operator*() const
|
300
|
+
{
|
301
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
302
|
+
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
303
|
+
"Attempted to dereference a non-dereferenceable list::iterator");
|
304
|
+
#endif
|
305
|
+
return __ptr_->__value_;
|
306
|
+
}
|
307
|
+
_LIBCPP_INLINE_VISIBILITY
|
308
|
+
pointer operator->() const {return &(operator*());}
|
309
|
+
|
310
|
+
_LIBCPP_INLINE_VISIBILITY
|
311
|
+
__list_iterator& operator++()
|
312
|
+
{
|
313
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
314
|
+
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
315
|
+
"Attempted to increment non-incrementable list::iterator");
|
316
|
+
#endif
|
317
|
+
__ptr_ = __ptr_->__next_;
|
318
|
+
return *this;
|
319
|
+
}
|
320
|
+
_LIBCPP_INLINE_VISIBILITY
|
321
|
+
__list_iterator operator++(int) {__list_iterator __t(*this); ++(*this); return __t;}
|
322
|
+
|
323
|
+
_LIBCPP_INLINE_VISIBILITY
|
324
|
+
__list_iterator& operator--()
|
325
|
+
{
|
326
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
327
|
+
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
328
|
+
"Attempted to decrement non-decrementable list::iterator");
|
329
|
+
#endif
|
330
|
+
__ptr_ = __ptr_->__prev_;
|
331
|
+
return *this;
|
332
|
+
}
|
333
|
+
_LIBCPP_INLINE_VISIBILITY
|
334
|
+
__list_iterator operator--(int) {__list_iterator __t(*this); --(*this); return __t;}
|
335
|
+
|
336
|
+
friend _LIBCPP_INLINE_VISIBILITY
|
337
|
+
bool operator==(const __list_iterator& __x, const __list_iterator& __y)
|
338
|
+
{
|
339
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
340
|
+
_LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
|
341
|
+
"Attempted to compare non-comparable list::iterator");
|
342
|
+
#endif
|
343
|
+
return __x.__ptr_ == __y.__ptr_;
|
344
|
+
}
|
345
|
+
friend _LIBCPP_INLINE_VISIBILITY
|
346
|
+
bool operator!=(const __list_iterator& __x, const __list_iterator& __y)
|
347
|
+
{return !(__x == __y);}
|
348
|
+
};
|
349
|
+
|
350
|
+
template <class _Tp, class _VoidPtr>
|
351
|
+
class _LIBCPP_TYPE_VIS __list_const_iterator
|
352
|
+
{
|
353
|
+
typedef typename pointer_traits<_VoidPtr>::template
|
354
|
+
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
355
|
+
rebind<const __list_node<_Tp, _VoidPtr> > __node_pointer;
|
356
|
+
#else
|
357
|
+
rebind<const __list_node<_Tp, _VoidPtr> >::other __node_pointer;
|
358
|
+
#endif
|
359
|
+
|
360
|
+
__node_pointer __ptr_;
|
361
|
+
|
362
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
363
|
+
_LIBCPP_INLINE_VISIBILITY
|
364
|
+
explicit __list_const_iterator(__node_pointer __p, const void* __c) _NOEXCEPT
|
365
|
+
: __ptr_(__p)
|
366
|
+
{
|
367
|
+
__get_db()->__insert_ic(this, __c);
|
368
|
+
}
|
369
|
+
#else
|
370
|
+
_LIBCPP_INLINE_VISIBILITY
|
371
|
+
explicit __list_const_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
372
|
+
#endif
|
373
|
+
|
374
|
+
template<class, class> friend class list;
|
375
|
+
template<class, class> friend class __list_imp;
|
376
|
+
public:
|
377
|
+
typedef bidirectional_iterator_tag iterator_category;
|
378
|
+
typedef _Tp value_type;
|
379
|
+
typedef const value_type& reference;
|
380
|
+
typedef typename pointer_traits<_VoidPtr>::template
|
381
|
+
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
382
|
+
rebind<const value_type>
|
383
|
+
#else
|
384
|
+
rebind<const value_type>::other
|
385
|
+
#endif
|
386
|
+
pointer;
|
387
|
+
typedef typename pointer_traits<pointer>::difference_type difference_type;
|
388
|
+
|
389
|
+
_LIBCPP_INLINE_VISIBILITY
|
390
|
+
__list_const_iterator() _NOEXCEPT
|
391
|
+
{
|
392
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
393
|
+
__get_db()->__insert_i(this);
|
394
|
+
#endif
|
395
|
+
}
|
396
|
+
_LIBCPP_INLINE_VISIBILITY
|
397
|
+
__list_const_iterator(__list_iterator<_Tp, _VoidPtr> __p) _NOEXCEPT
|
398
|
+
: __ptr_(__p.__ptr_)
|
399
|
+
{
|
400
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
401
|
+
__get_db()->__iterator_copy(this, &__p);
|
402
|
+
#endif
|
403
|
+
}
|
404
|
+
|
405
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
406
|
+
|
407
|
+
_LIBCPP_INLINE_VISIBILITY
|
408
|
+
__list_const_iterator(const __list_const_iterator& __p)
|
409
|
+
: __ptr_(__p.__ptr_)
|
410
|
+
{
|
411
|
+
__get_db()->__iterator_copy(this, &__p);
|
412
|
+
}
|
413
|
+
|
414
|
+
_LIBCPP_INLINE_VISIBILITY
|
415
|
+
~__list_const_iterator()
|
416
|
+
{
|
417
|
+
__get_db()->__erase_i(this);
|
418
|
+
}
|
419
|
+
|
420
|
+
_LIBCPP_INLINE_VISIBILITY
|
421
|
+
__list_const_iterator& operator=(const __list_const_iterator& __p)
|
422
|
+
{
|
423
|
+
if (this != &__p)
|
424
|
+
{
|
425
|
+
__get_db()->__iterator_copy(this, &__p);
|
426
|
+
__ptr_ = __p.__ptr_;
|
427
|
+
}
|
428
|
+
return *this;
|
429
|
+
}
|
430
|
+
|
431
|
+
#endif // _LIBCPP_DEBUG_LEVEL >= 2
|
432
|
+
_LIBCPP_INLINE_VISIBILITY
|
433
|
+
reference operator*() const
|
434
|
+
{
|
435
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
436
|
+
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
437
|
+
"Attempted to dereference a non-dereferenceable list::const_iterator");
|
438
|
+
#endif
|
439
|
+
return __ptr_->__value_;
|
440
|
+
}
|
441
|
+
_LIBCPP_INLINE_VISIBILITY
|
442
|
+
pointer operator->() const {return &(operator*());}
|
443
|
+
|
444
|
+
_LIBCPP_INLINE_VISIBILITY
|
445
|
+
__list_const_iterator& operator++()
|
446
|
+
{
|
447
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
448
|
+
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
449
|
+
"Attempted to increment non-incrementable list::const_iterator");
|
450
|
+
#endif
|
451
|
+
__ptr_ = __ptr_->__next_;
|
452
|
+
return *this;
|
453
|
+
}
|
454
|
+
_LIBCPP_INLINE_VISIBILITY
|
455
|
+
__list_const_iterator operator++(int) {__list_const_iterator __t(*this); ++(*this); return __t;}
|
456
|
+
|
457
|
+
_LIBCPP_INLINE_VISIBILITY
|
458
|
+
__list_const_iterator& operator--()
|
459
|
+
{
|
460
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
461
|
+
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
|
462
|
+
"Attempted to decrement non-decrementable list::const_iterator");
|
463
|
+
#endif
|
464
|
+
__ptr_ = __ptr_->__prev_;
|
465
|
+
return *this;
|
466
|
+
}
|
467
|
+
_LIBCPP_INLINE_VISIBILITY
|
468
|
+
__list_const_iterator operator--(int) {__list_const_iterator __t(*this); --(*this); return __t;}
|
469
|
+
|
470
|
+
friend _LIBCPP_INLINE_VISIBILITY
|
471
|
+
bool operator==(const __list_const_iterator& __x, const __list_const_iterator& __y)
|
472
|
+
{
|
473
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
474
|
+
_LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
|
475
|
+
"Attempted to compare non-comparable list::const_iterator");
|
476
|
+
#endif
|
477
|
+
return __x.__ptr_ == __y.__ptr_;
|
478
|
+
}
|
479
|
+
friend _LIBCPP_INLINE_VISIBILITY
|
480
|
+
bool operator!=(const __list_const_iterator& __x, const __list_const_iterator& __y)
|
481
|
+
{return !(__x == __y);}
|
482
|
+
};
|
483
|
+
|
484
|
+
template <class _Tp, class _Alloc>
|
485
|
+
class __list_imp
|
486
|
+
{
|
487
|
+
__list_imp(const __list_imp&);
|
488
|
+
__list_imp& operator=(const __list_imp&);
|
489
|
+
protected:
|
490
|
+
typedef _Tp value_type;
|
491
|
+
typedef _Alloc allocator_type;
|
492
|
+
typedef allocator_traits<allocator_type> __alloc_traits;
|
493
|
+
typedef typename __alloc_traits::size_type size_type;
|
494
|
+
typedef typename __alloc_traits::void_pointer __void_pointer;
|
495
|
+
typedef __list_iterator<value_type, __void_pointer> iterator;
|
496
|
+
typedef __list_const_iterator<value_type, __void_pointer> const_iterator;
|
497
|
+
typedef __list_node_base<value_type, __void_pointer> __node_base;
|
498
|
+
typedef __list_node<value_type, __void_pointer> __node;
|
499
|
+
typedef typename __alloc_traits::template
|
500
|
+
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
501
|
+
rebind_alloc<__node>
|
502
|
+
#else
|
503
|
+
rebind_alloc<__node>::other
|
504
|
+
#endif
|
505
|
+
__node_allocator;
|
506
|
+
typedef allocator_traits<__node_allocator> __node_alloc_traits;
|
507
|
+
typedef typename __node_alloc_traits::pointer __node_pointer;
|
508
|
+
typedef typename __node_alloc_traits::const_pointer __node_const_pointer;
|
509
|
+
typedef typename __alloc_traits::pointer pointer;
|
510
|
+
typedef typename __alloc_traits::const_pointer const_pointer;
|
511
|
+
typedef typename __alloc_traits::difference_type difference_type;
|
512
|
+
|
513
|
+
__node_base __end_;
|
514
|
+
__compressed_pair<size_type, __node_allocator> __size_alloc_;
|
515
|
+
|
516
|
+
_LIBCPP_INLINE_VISIBILITY
|
517
|
+
size_type& __sz() _NOEXCEPT {return __size_alloc_.first();}
|
518
|
+
_LIBCPP_INLINE_VISIBILITY
|
519
|
+
const size_type& __sz() const _NOEXCEPT
|
520
|
+
{return __size_alloc_.first();}
|
521
|
+
_LIBCPP_INLINE_VISIBILITY
|
522
|
+
__node_allocator& __node_alloc() _NOEXCEPT
|
523
|
+
{return __size_alloc_.second();}
|
524
|
+
_LIBCPP_INLINE_VISIBILITY
|
525
|
+
const __node_allocator& __node_alloc() const _NOEXCEPT
|
526
|
+
{return __size_alloc_.second();}
|
527
|
+
|
528
|
+
static void __unlink_nodes(__node_base& __f, __node_base& __l) _NOEXCEPT;
|
529
|
+
|
530
|
+
__list_imp()
|
531
|
+
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value);
|
532
|
+
__list_imp(const allocator_type& __a);
|
533
|
+
~__list_imp();
|
534
|
+
void clear() _NOEXCEPT;
|
535
|
+
_LIBCPP_INLINE_VISIBILITY
|
536
|
+
bool empty() const _NOEXCEPT {return __sz() == 0;}
|
537
|
+
|
538
|
+
_LIBCPP_INLINE_VISIBILITY
|
539
|
+
iterator begin() _NOEXCEPT
|
540
|
+
{
|
541
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
542
|
+
return iterator(__end_.__next_, this);
|
543
|
+
#else
|
544
|
+
return iterator(__end_.__next_);
|
545
|
+
#endif
|
546
|
+
}
|
547
|
+
_LIBCPP_INLINE_VISIBILITY
|
548
|
+
const_iterator begin() const _NOEXCEPT
|
549
|
+
{
|
550
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
551
|
+
return const_iterator(__end_.__next_, this);
|
552
|
+
#else
|
553
|
+
return const_iterator(__end_.__next_);
|
554
|
+
#endif
|
555
|
+
}
|
556
|
+
_LIBCPP_INLINE_VISIBILITY
|
557
|
+
iterator end() _NOEXCEPT
|
558
|
+
{
|
559
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
560
|
+
return iterator(static_cast<__node_pointer>(&__end_), this);
|
561
|
+
#else
|
562
|
+
return iterator(static_cast<__node_pointer>(&__end_));
|
563
|
+
#endif
|
564
|
+
}
|
565
|
+
_LIBCPP_INLINE_VISIBILITY
|
566
|
+
const_iterator end() const _NOEXCEPT
|
567
|
+
{
|
568
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
569
|
+
return const_iterator(static_cast<__node_const_pointer>(&__end_), this);
|
570
|
+
#else
|
571
|
+
return const_iterator(static_cast<__node_const_pointer>(&__end_));
|
572
|
+
#endif
|
573
|
+
}
|
574
|
+
|
575
|
+
void swap(__list_imp& __c)
|
576
|
+
_NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
|
577
|
+
__is_nothrow_swappable<__node_allocator>::value);
|
578
|
+
|
579
|
+
_LIBCPP_INLINE_VISIBILITY
|
580
|
+
void __copy_assign_alloc(const __list_imp& __c)
|
581
|
+
{__copy_assign_alloc(__c, integral_constant<bool,
|
582
|
+
__node_alloc_traits::propagate_on_container_copy_assignment::value>());}
|
583
|
+
|
584
|
+
_LIBCPP_INLINE_VISIBILITY
|
585
|
+
void __move_assign_alloc(__list_imp& __c)
|
586
|
+
_NOEXCEPT_(
|
587
|
+
!__node_alloc_traits::propagate_on_container_move_assignment::value ||
|
588
|
+
is_nothrow_move_assignable<__node_allocator>::value)
|
589
|
+
{__move_assign_alloc(__c, integral_constant<bool,
|
590
|
+
__node_alloc_traits::propagate_on_container_move_assignment::value>());}
|
591
|
+
|
592
|
+
private:
|
593
|
+
_LIBCPP_INLINE_VISIBILITY
|
594
|
+
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y)
|
595
|
+
_NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
|
596
|
+
__is_nothrow_swappable<__node_allocator>::value)
|
597
|
+
{__swap_alloc(__x, __y, integral_constant<bool,
|
598
|
+
__node_alloc_traits::propagate_on_container_swap::value>());}
|
599
|
+
_LIBCPP_INLINE_VISIBILITY
|
600
|
+
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, true_type)
|
601
|
+
_NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
|
602
|
+
{
|
603
|
+
using _VSTD::swap;
|
604
|
+
swap(__x, __y);
|
605
|
+
}
|
606
|
+
_LIBCPP_INLINE_VISIBILITY
|
607
|
+
static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, false_type)
|
608
|
+
_NOEXCEPT
|
609
|
+
{}
|
610
|
+
|
611
|
+
_LIBCPP_INLINE_VISIBILITY
|
612
|
+
void __copy_assign_alloc(const __list_imp& __c, true_type)
|
613
|
+
{
|
614
|
+
if (__node_alloc() != __c.__node_alloc())
|
615
|
+
clear();
|
616
|
+
__node_alloc() = __c.__node_alloc();
|
617
|
+
}
|
618
|
+
|
619
|
+
_LIBCPP_INLINE_VISIBILITY
|
620
|
+
void __copy_assign_alloc(const __list_imp& __c, false_type)
|
621
|
+
{}
|
622
|
+
|
623
|
+
_LIBCPP_INLINE_VISIBILITY
|
624
|
+
void __move_assign_alloc(__list_imp& __c, true_type)
|
625
|
+
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
626
|
+
{
|
627
|
+
__node_alloc() = _VSTD::move(__c.__node_alloc());
|
628
|
+
}
|
629
|
+
|
630
|
+
_LIBCPP_INLINE_VISIBILITY
|
631
|
+
void __move_assign_alloc(__list_imp& __c, false_type)
|
632
|
+
_NOEXCEPT
|
633
|
+
{}
|
634
|
+
};
|
635
|
+
|
636
|
+
// Unlink nodes [__f, __l]
|
637
|
+
template <class _Tp, class _Alloc>
|
638
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
639
|
+
void
|
640
|
+
__list_imp<_Tp, _Alloc>::__unlink_nodes(__node_base& __f, __node_base& __l)
|
641
|
+
_NOEXCEPT
|
642
|
+
{
|
643
|
+
__f.__prev_->__next_ = __l.__next_;
|
644
|
+
__l.__next_->__prev_ = __f.__prev_;
|
645
|
+
}
|
646
|
+
|
647
|
+
template <class _Tp, class _Alloc>
|
648
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
649
|
+
__list_imp<_Tp, _Alloc>::__list_imp()
|
650
|
+
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
|
651
|
+
: __size_alloc_(0)
|
652
|
+
{
|
653
|
+
}
|
654
|
+
|
655
|
+
template <class _Tp, class _Alloc>
|
656
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
657
|
+
__list_imp<_Tp, _Alloc>::__list_imp(const allocator_type& __a)
|
658
|
+
: __size_alloc_(0, __node_allocator(__a))
|
659
|
+
{
|
660
|
+
}
|
661
|
+
|
662
|
+
template <class _Tp, class _Alloc>
|
663
|
+
__list_imp<_Tp, _Alloc>::~__list_imp()
|
664
|
+
{
|
665
|
+
clear();
|
666
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
667
|
+
__get_db()->__erase_c(this);
|
668
|
+
#endif
|
669
|
+
}
|
670
|
+
|
671
|
+
template <class _Tp, class _Alloc>
|
672
|
+
void
|
673
|
+
__list_imp<_Tp, _Alloc>::clear() _NOEXCEPT
|
674
|
+
{
|
675
|
+
if (!empty())
|
676
|
+
{
|
677
|
+
__node_allocator& __na = __node_alloc();
|
678
|
+
__node_pointer __f = __end_.__next_;
|
679
|
+
__node_pointer __l = static_cast<__node_pointer>(&__end_);
|
680
|
+
__unlink_nodes(*__f, *__l->__prev_);
|
681
|
+
__sz() = 0;
|
682
|
+
while (__f != __l)
|
683
|
+
{
|
684
|
+
__node& __n = *__f;
|
685
|
+
__f = __f->__next_;
|
686
|
+
__node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
|
687
|
+
__node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
|
688
|
+
}
|
689
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
690
|
+
__c_node* __c = __get_db()->__find_c_and_lock(this);
|
691
|
+
for (__i_node** __p = __c->end_; __p != __c->beg_; )
|
692
|
+
{
|
693
|
+
--__p;
|
694
|
+
const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
|
695
|
+
if (__i->__ptr_ != __l)
|
696
|
+
{
|
697
|
+
(*__p)->__c_ = nullptr;
|
698
|
+
if (--__c->end_ != __p)
|
699
|
+
memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
|
700
|
+
}
|
701
|
+
}
|
702
|
+
__get_db()->unlock();
|
703
|
+
#endif
|
704
|
+
}
|
705
|
+
}
|
706
|
+
|
707
|
+
template <class _Tp, class _Alloc>
|
708
|
+
void
|
709
|
+
__list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
|
710
|
+
_NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
|
711
|
+
__is_nothrow_swappable<__node_allocator>::value)
|
712
|
+
{
|
713
|
+
_LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value ||
|
714
|
+
this->__node_alloc() == __c.__node_alloc(),
|
715
|
+
"list::swap: Either propagate_on_container_swap must be true"
|
716
|
+
" or the allocators must compare equal");
|
717
|
+
using _VSTD::swap;
|
718
|
+
__swap_alloc(__node_alloc(), __c.__node_alloc());
|
719
|
+
swap(__sz(), __c.__sz());
|
720
|
+
swap(__end_, __c.__end_);
|
721
|
+
if (__sz() == 0)
|
722
|
+
__end_.__next_ = __end_.__prev_ = &static_cast<__node&>(__end_);
|
723
|
+
else
|
724
|
+
__end_.__prev_->__next_ = __end_.__next_->__prev_
|
725
|
+
= &static_cast<__node&>(__end_);
|
726
|
+
if (__c.__sz() == 0)
|
727
|
+
__c.__end_.__next_ = __c.__end_.__prev_
|
728
|
+
= &static_cast<__node&>(__c.__end_);
|
729
|
+
else
|
730
|
+
__c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_
|
731
|
+
= &static_cast<__node&>(__c.__end_);
|
732
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
733
|
+
__libcpp_db* __db = __get_db();
|
734
|
+
__c_node* __cn1 = __db->__find_c_and_lock(this);
|
735
|
+
__c_node* __cn2 = __db->__find_c(&__c);
|
736
|
+
std::swap(__cn1->beg_, __cn2->beg_);
|
737
|
+
std::swap(__cn1->end_, __cn2->end_);
|
738
|
+
std::swap(__cn1->cap_, __cn2->cap_);
|
739
|
+
for (__i_node** __p = __cn1->end_; __p != __cn1->beg_;)
|
740
|
+
{
|
741
|
+
--__p;
|
742
|
+
const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
|
743
|
+
if (__i->__ptr_ == static_cast<__node_pointer>(&__c.__end_))
|
744
|
+
{
|
745
|
+
__cn2->__add(*__p);
|
746
|
+
if (--__cn1->end_ != __p)
|
747
|
+
memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*));
|
748
|
+
}
|
749
|
+
else
|
750
|
+
(*__p)->__c_ = __cn1;
|
751
|
+
}
|
752
|
+
for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
|
753
|
+
{
|
754
|
+
--__p;
|
755
|
+
const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
|
756
|
+
if (__i->__ptr_ == static_cast<__node_pointer>(&__end_))
|
757
|
+
{
|
758
|
+
__cn1->__add(*__p);
|
759
|
+
if (--__cn2->end_ != __p)
|
760
|
+
memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
|
761
|
+
}
|
762
|
+
else
|
763
|
+
(*__p)->__c_ = __cn2;
|
764
|
+
}
|
765
|
+
__db->unlock();
|
766
|
+
#endif
|
767
|
+
}
|
768
|
+
|
769
|
+
template <class _Tp, class _Alloc = allocator<_Tp> >
|
770
|
+
class _LIBCPP_TYPE_VIS list
|
771
|
+
: private __list_imp<_Tp, _Alloc>
|
772
|
+
{
|
773
|
+
typedef __list_imp<_Tp, _Alloc> base;
|
774
|
+
typedef typename base::__node __node;
|
775
|
+
typedef typename base::__node_allocator __node_allocator;
|
776
|
+
typedef typename base::__node_pointer __node_pointer;
|
777
|
+
typedef typename base::__node_alloc_traits __node_alloc_traits;
|
778
|
+
|
779
|
+
public:
|
780
|
+
typedef _Tp value_type;
|
781
|
+
typedef _Alloc allocator_type;
|
782
|
+
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
|
783
|
+
"Invalid allocator::value_type");
|
784
|
+
typedef value_type& reference;
|
785
|
+
typedef const value_type& const_reference;
|
786
|
+
typedef typename base::pointer pointer;
|
787
|
+
typedef typename base::const_pointer const_pointer;
|
788
|
+
typedef typename base::size_type size_type;
|
789
|
+
typedef typename base::difference_type difference_type;
|
790
|
+
typedef typename base::iterator iterator;
|
791
|
+
typedef typename base::const_iterator const_iterator;
|
792
|
+
typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
|
793
|
+
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
794
|
+
|
795
|
+
_LIBCPP_INLINE_VISIBILITY
|
796
|
+
list()
|
797
|
+
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
|
798
|
+
{
|
799
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
800
|
+
__get_db()->__insert_c(this);
|
801
|
+
#endif
|
802
|
+
}
|
803
|
+
_LIBCPP_INLINE_VISIBILITY
|
804
|
+
list(const allocator_type& __a) : base(__a)
|
805
|
+
{
|
806
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
807
|
+
__get_db()->__insert_c(this);
|
808
|
+
#endif
|
809
|
+
}
|
810
|
+
list(size_type __n);
|
811
|
+
list(size_type __n, const value_type& __x);
|
812
|
+
list(size_type __n, const value_type& __x, const allocator_type& __a);
|
813
|
+
template <class _InpIter>
|
814
|
+
list(_InpIter __f, _InpIter __l,
|
815
|
+
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
816
|
+
template <class _InpIter>
|
817
|
+
list(_InpIter __f, _InpIter __l, const allocator_type& __a,
|
818
|
+
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
819
|
+
|
820
|
+
list(const list& __c);
|
821
|
+
list(const list& __c, const allocator_type& __a);
|
822
|
+
list& operator=(const list& __c);
|
823
|
+
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
824
|
+
list(initializer_list<value_type> __il);
|
825
|
+
list(initializer_list<value_type> __il, const allocator_type& __a);
|
826
|
+
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
827
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
828
|
+
list(list&& __c)
|
829
|
+
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
|
830
|
+
list(list&& __c, const allocator_type& __a);
|
831
|
+
list& operator=(list&& __c)
|
832
|
+
_NOEXCEPT_(
|
833
|
+
__node_alloc_traits::propagate_on_container_move_assignment::value &&
|
834
|
+
is_nothrow_move_assignable<__node_allocator>::value);
|
835
|
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
836
|
+
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
837
|
+
_LIBCPP_INLINE_VISIBILITY
|
838
|
+
list& operator=(initializer_list<value_type> __il)
|
839
|
+
{assign(__il.begin(), __il.end()); return *this;}
|
840
|
+
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
841
|
+
|
842
|
+
template <class _InpIter>
|
843
|
+
void assign(_InpIter __f, _InpIter __l,
|
844
|
+
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
845
|
+
void assign(size_type __n, const value_type& __x);
|
846
|
+
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
847
|
+
_LIBCPP_INLINE_VISIBILITY
|
848
|
+
void assign(initializer_list<value_type> __il)
|
849
|
+
{assign(__il.begin(), __il.end());}
|
850
|
+
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
851
|
+
|
852
|
+
allocator_type get_allocator() const _NOEXCEPT;
|
853
|
+
|
854
|
+
_LIBCPP_INLINE_VISIBILITY
|
855
|
+
size_type size() const _NOEXCEPT {return base::__sz();}
|
856
|
+
_LIBCPP_INLINE_VISIBILITY
|
857
|
+
bool empty() const _NOEXCEPT {return base::empty();}
|
858
|
+
_LIBCPP_INLINE_VISIBILITY
|
859
|
+
size_type max_size() const _NOEXCEPT
|
860
|
+
{return numeric_limits<difference_type>::max();}
|
861
|
+
|
862
|
+
_LIBCPP_INLINE_VISIBILITY
|
863
|
+
iterator begin() _NOEXCEPT {return base::begin();}
|
864
|
+
_LIBCPP_INLINE_VISIBILITY
|
865
|
+
const_iterator begin() const _NOEXCEPT {return base::begin();}
|
866
|
+
_LIBCPP_INLINE_VISIBILITY
|
867
|
+
iterator end() _NOEXCEPT {return base::end();}
|
868
|
+
_LIBCPP_INLINE_VISIBILITY
|
869
|
+
const_iterator end() const _NOEXCEPT {return base::end();}
|
870
|
+
_LIBCPP_INLINE_VISIBILITY
|
871
|
+
const_iterator cbegin() const _NOEXCEPT {return base::begin();}
|
872
|
+
_LIBCPP_INLINE_VISIBILITY
|
873
|
+
const_iterator cend() const _NOEXCEPT {return base::end();}
|
874
|
+
|
875
|
+
_LIBCPP_INLINE_VISIBILITY
|
876
|
+
reverse_iterator rbegin() _NOEXCEPT
|
877
|
+
{return reverse_iterator(end());}
|
878
|
+
_LIBCPP_INLINE_VISIBILITY
|
879
|
+
const_reverse_iterator rbegin() const _NOEXCEPT
|
880
|
+
{return const_reverse_iterator(end());}
|
881
|
+
_LIBCPP_INLINE_VISIBILITY
|
882
|
+
reverse_iterator rend() _NOEXCEPT
|
883
|
+
{return reverse_iterator(begin());}
|
884
|
+
_LIBCPP_INLINE_VISIBILITY
|
885
|
+
const_reverse_iterator rend() const _NOEXCEPT
|
886
|
+
{return const_reverse_iterator(begin());}
|
887
|
+
_LIBCPP_INLINE_VISIBILITY
|
888
|
+
const_reverse_iterator crbegin() const _NOEXCEPT
|
889
|
+
{return const_reverse_iterator(end());}
|
890
|
+
_LIBCPP_INLINE_VISIBILITY
|
891
|
+
const_reverse_iterator crend() const _NOEXCEPT
|
892
|
+
{return const_reverse_iterator(begin());}
|
893
|
+
|
894
|
+
_LIBCPP_INLINE_VISIBILITY
|
895
|
+
reference front()
|
896
|
+
{
|
897
|
+
_LIBCPP_ASSERT(!empty(), "list::front called on empty list");
|
898
|
+
return base::__end_.__next_->__value_;
|
899
|
+
}
|
900
|
+
_LIBCPP_INLINE_VISIBILITY
|
901
|
+
const_reference front() const
|
902
|
+
{
|
903
|
+
_LIBCPP_ASSERT(!empty(), "list::front called on empty list");
|
904
|
+
return base::__end_.__next_->__value_;
|
905
|
+
}
|
906
|
+
_LIBCPP_INLINE_VISIBILITY
|
907
|
+
reference back()
|
908
|
+
{
|
909
|
+
_LIBCPP_ASSERT(!empty(), "list::back called on empty list");
|
910
|
+
return base::__end_.__prev_->__value_;
|
911
|
+
}
|
912
|
+
_LIBCPP_INLINE_VISIBILITY
|
913
|
+
const_reference back() const
|
914
|
+
{
|
915
|
+
_LIBCPP_ASSERT(!empty(), "list::back called on empty list");
|
916
|
+
return base::__end_.__prev_->__value_;
|
917
|
+
}
|
918
|
+
|
919
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
920
|
+
void push_front(value_type&& __x);
|
921
|
+
void push_back(value_type&& __x);
|
922
|
+
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
923
|
+
template <class... _Args>
|
924
|
+
void emplace_front(_Args&&... __args);
|
925
|
+
template <class... _Args>
|
926
|
+
void emplace_back(_Args&&... __args);
|
927
|
+
template <class... _Args>
|
928
|
+
iterator emplace(const_iterator __p, _Args&&... __args);
|
929
|
+
#endif // _LIBCPP_HAS_NO_VARIADICS
|
930
|
+
iterator insert(const_iterator __p, value_type&& __x);
|
931
|
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
932
|
+
|
933
|
+
void push_front(const value_type& __x);
|
934
|
+
void push_back(const value_type& __x);
|
935
|
+
|
936
|
+
iterator insert(const_iterator __p, const value_type& __x);
|
937
|
+
iterator insert(const_iterator __p, size_type __n, const value_type& __x);
|
938
|
+
template <class _InpIter>
|
939
|
+
iterator insert(const_iterator __p, _InpIter __f, _InpIter __l,
|
940
|
+
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
|
941
|
+
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
942
|
+
_LIBCPP_INLINE_VISIBILITY
|
943
|
+
iterator insert(const_iterator __p, initializer_list<value_type> __il)
|
944
|
+
{return insert(__p, __il.begin(), __il.end());}
|
945
|
+
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
946
|
+
|
947
|
+
_LIBCPP_INLINE_VISIBILITY
|
948
|
+
void swap(list& __c)
|
949
|
+
_NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
|
950
|
+
__is_nothrow_swappable<__node_allocator>::value)
|
951
|
+
{base::swap(__c);}
|
952
|
+
_LIBCPP_INLINE_VISIBILITY
|
953
|
+
void clear() _NOEXCEPT {base::clear();}
|
954
|
+
|
955
|
+
void pop_front();
|
956
|
+
void pop_back();
|
957
|
+
|
958
|
+
iterator erase(const_iterator __p);
|
959
|
+
iterator erase(const_iterator __f, const_iterator __l);
|
960
|
+
|
961
|
+
void resize(size_type __n);
|
962
|
+
void resize(size_type __n, const value_type& __x);
|
963
|
+
|
964
|
+
void splice(const_iterator __p, list& __c);
|
965
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
966
|
+
_LIBCPP_INLINE_VISIBILITY
|
967
|
+
void splice(const_iterator __p, list&& __c) {splice(__p, __c);}
|
968
|
+
#endif
|
969
|
+
void splice(const_iterator __p, list& __c, const_iterator __i);
|
970
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
971
|
+
_LIBCPP_INLINE_VISIBILITY
|
972
|
+
void splice(const_iterator __p, list&& __c, const_iterator __i)
|
973
|
+
{splice(__p, __c, __i);}
|
974
|
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
975
|
+
void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
|
976
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
977
|
+
_LIBCPP_INLINE_VISIBILITY
|
978
|
+
void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l)
|
979
|
+
{splice(__p, __c, __f, __l);}
|
980
|
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
981
|
+
|
982
|
+
void remove(const value_type& __x);
|
983
|
+
template <class _Pred> void remove_if(_Pred __pred);
|
984
|
+
void unique();
|
985
|
+
template <class _BinaryPred>
|
986
|
+
void unique(_BinaryPred __binary_pred);
|
987
|
+
void merge(list& __c);
|
988
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
989
|
+
_LIBCPP_INLINE_VISIBILITY
|
990
|
+
void merge(list&& __c) {merge(__c);}
|
991
|
+
#endif
|
992
|
+
template <class _Comp>
|
993
|
+
void merge(list& __c, _Comp __comp);
|
994
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
995
|
+
template <class _Comp>
|
996
|
+
_LIBCPP_INLINE_VISIBILITY
|
997
|
+
void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
|
998
|
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
999
|
+
void sort();
|
1000
|
+
template <class _Comp>
|
1001
|
+
void sort(_Comp __comp);
|
1002
|
+
|
1003
|
+
void reverse() _NOEXCEPT;
|
1004
|
+
|
1005
|
+
bool __invariants() const;
|
1006
|
+
|
1007
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1008
|
+
|
1009
|
+
bool __dereferenceable(const const_iterator* __i) const;
|
1010
|
+
bool __decrementable(const const_iterator* __i) const;
|
1011
|
+
bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
|
1012
|
+
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
|
1013
|
+
|
1014
|
+
#endif // _LIBCPP_DEBUG_LEVEL >= 2
|
1015
|
+
|
1016
|
+
private:
|
1017
|
+
static void __link_nodes(__node& __p, __node& __f, __node& __l);
|
1018
|
+
iterator __iterator(size_type __n);
|
1019
|
+
template <class _Comp>
|
1020
|
+
static iterator __sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp);
|
1021
|
+
|
1022
|
+
void __move_assign(list& __c, true_type)
|
1023
|
+
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value);
|
1024
|
+
void __move_assign(list& __c, false_type);
|
1025
|
+
};
|
1026
|
+
|
1027
|
+
// Link in nodes [__f, __l] just prior to __p
|
1028
|
+
template <class _Tp, class _Alloc>
|
1029
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
1030
|
+
void
|
1031
|
+
list<_Tp, _Alloc>::__link_nodes(__node& __p, __node& __f, __node& __l)
|
1032
|
+
{
|
1033
|
+
__p.__prev_->__next_ = &__f;
|
1034
|
+
__f.__prev_ = __p.__prev_;
|
1035
|
+
__p.__prev_ = &__l;
|
1036
|
+
__l.__next_ = &__p;
|
1037
|
+
}
|
1038
|
+
|
1039
|
+
template <class _Tp, class _Alloc>
|
1040
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
1041
|
+
typename list<_Tp, _Alloc>::iterator
|
1042
|
+
list<_Tp, _Alloc>::__iterator(size_type __n)
|
1043
|
+
{
|
1044
|
+
return __n <= base::__sz() / 2 ? _VSTD::next(begin(), __n)
|
1045
|
+
: _VSTD::prev(end(), base::__sz() - __n);
|
1046
|
+
}
|
1047
|
+
|
1048
|
+
template <class _Tp, class _Alloc>
|
1049
|
+
list<_Tp, _Alloc>::list(size_type __n)
|
1050
|
+
{
|
1051
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1052
|
+
__get_db()->__insert_c(this);
|
1053
|
+
#endif
|
1054
|
+
for (; __n > 0; --__n)
|
1055
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
1056
|
+
emplace_back();
|
1057
|
+
#else
|
1058
|
+
push_back(value_type());
|
1059
|
+
#endif
|
1060
|
+
}
|
1061
|
+
|
1062
|
+
template <class _Tp, class _Alloc>
|
1063
|
+
list<_Tp, _Alloc>::list(size_type __n, const value_type& __x)
|
1064
|
+
{
|
1065
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1066
|
+
__get_db()->__insert_c(this);
|
1067
|
+
#endif
|
1068
|
+
for (; __n > 0; --__n)
|
1069
|
+
push_back(__x);
|
1070
|
+
}
|
1071
|
+
|
1072
|
+
template <class _Tp, class _Alloc>
|
1073
|
+
list<_Tp, _Alloc>::list(size_type __n, const value_type& __x, const allocator_type& __a)
|
1074
|
+
: base(__a)
|
1075
|
+
{
|
1076
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1077
|
+
__get_db()->__insert_c(this);
|
1078
|
+
#endif
|
1079
|
+
for (; __n > 0; --__n)
|
1080
|
+
push_back(__x);
|
1081
|
+
}
|
1082
|
+
|
1083
|
+
template <class _Tp, class _Alloc>
|
1084
|
+
template <class _InpIter>
|
1085
|
+
list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l,
|
1086
|
+
typename enable_if<__is_input_iterator<_InpIter>::value>::type*)
|
1087
|
+
{
|
1088
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1089
|
+
__get_db()->__insert_c(this);
|
1090
|
+
#endif
|
1091
|
+
for (; __f != __l; ++__f)
|
1092
|
+
push_back(*__f);
|
1093
|
+
}
|
1094
|
+
|
1095
|
+
template <class _Tp, class _Alloc>
|
1096
|
+
template <class _InpIter>
|
1097
|
+
list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a,
|
1098
|
+
typename enable_if<__is_input_iterator<_InpIter>::value>::type*)
|
1099
|
+
: base(__a)
|
1100
|
+
{
|
1101
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1102
|
+
__get_db()->__insert_c(this);
|
1103
|
+
#endif
|
1104
|
+
for (; __f != __l; ++__f)
|
1105
|
+
push_back(*__f);
|
1106
|
+
}
|
1107
|
+
|
1108
|
+
template <class _Tp, class _Alloc>
|
1109
|
+
list<_Tp, _Alloc>::list(const list& __c)
|
1110
|
+
: base(allocator_type(
|
1111
|
+
__node_alloc_traits::select_on_container_copy_construction(
|
1112
|
+
__c.__node_alloc())))
|
1113
|
+
{
|
1114
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1115
|
+
__get_db()->__insert_c(this);
|
1116
|
+
#endif
|
1117
|
+
for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
|
1118
|
+
push_back(*__i);
|
1119
|
+
}
|
1120
|
+
|
1121
|
+
template <class _Tp, class _Alloc>
|
1122
|
+
list<_Tp, _Alloc>::list(const list& __c, const allocator_type& __a)
|
1123
|
+
: base(__a)
|
1124
|
+
{
|
1125
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1126
|
+
__get_db()->__insert_c(this);
|
1127
|
+
#endif
|
1128
|
+
for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
|
1129
|
+
push_back(*__i);
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
1133
|
+
|
1134
|
+
template <class _Tp, class _Alloc>
|
1135
|
+
list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
|
1136
|
+
: base(__a)
|
1137
|
+
{
|
1138
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1139
|
+
__get_db()->__insert_c(this);
|
1140
|
+
#endif
|
1141
|
+
for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
|
1142
|
+
__e = __il.end(); __i != __e; ++__i)
|
1143
|
+
push_back(*__i);
|
1144
|
+
}
|
1145
|
+
|
1146
|
+
template <class _Tp, class _Alloc>
|
1147
|
+
list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
|
1148
|
+
{
|
1149
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1150
|
+
__get_db()->__insert_c(this);
|
1151
|
+
#endif
|
1152
|
+
for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
|
1153
|
+
__e = __il.end(); __i != __e; ++__i)
|
1154
|
+
push_back(*__i);
|
1155
|
+
}
|
1156
|
+
|
1157
|
+
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
1158
|
+
|
1159
|
+
template <class _Tp, class _Alloc>
|
1160
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
1161
|
+
list<_Tp, _Alloc>&
|
1162
|
+
list<_Tp, _Alloc>::operator=(const list& __c)
|
1163
|
+
{
|
1164
|
+
if (this != &__c)
|
1165
|
+
{
|
1166
|
+
base::__copy_assign_alloc(__c);
|
1167
|
+
assign(__c.begin(), __c.end());
|
1168
|
+
}
|
1169
|
+
return *this;
|
1170
|
+
}
|
1171
|
+
|
1172
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
1173
|
+
|
1174
|
+
template <class _Tp, class _Alloc>
|
1175
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
1176
|
+
list<_Tp, _Alloc>::list(list&& __c)
|
1177
|
+
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
|
1178
|
+
: base(allocator_type(_VSTD::move(__c.__node_alloc())))
|
1179
|
+
{
|
1180
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1181
|
+
__get_db()->__insert_c(this);
|
1182
|
+
#endif
|
1183
|
+
splice(end(), __c);
|
1184
|
+
}
|
1185
|
+
|
1186
|
+
template <class _Tp, class _Alloc>
|
1187
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
1188
|
+
list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
|
1189
|
+
: base(__a)
|
1190
|
+
{
|
1191
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1192
|
+
__get_db()->__insert_c(this);
|
1193
|
+
#endif
|
1194
|
+
if (__a == __c.get_allocator())
|
1195
|
+
splice(end(), __c);
|
1196
|
+
else
|
1197
|
+
{
|
1198
|
+
typedef move_iterator<iterator> _Ip;
|
1199
|
+
assign(_Ip(__c.begin()), _Ip(__c.end()));
|
1200
|
+
}
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
template <class _Tp, class _Alloc>
|
1204
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
1205
|
+
list<_Tp, _Alloc>&
|
1206
|
+
list<_Tp, _Alloc>::operator=(list&& __c)
|
1207
|
+
_NOEXCEPT_(
|
1208
|
+
__node_alloc_traits::propagate_on_container_move_assignment::value &&
|
1209
|
+
is_nothrow_move_assignable<__node_allocator>::value)
|
1210
|
+
{
|
1211
|
+
__move_assign(__c, integral_constant<bool,
|
1212
|
+
__node_alloc_traits::propagate_on_container_move_assignment::value>());
|
1213
|
+
return *this;
|
1214
|
+
}
|
1215
|
+
|
1216
|
+
template <class _Tp, class _Alloc>
|
1217
|
+
void
|
1218
|
+
list<_Tp, _Alloc>::__move_assign(list& __c, false_type)
|
1219
|
+
{
|
1220
|
+
if (base::__node_alloc() != __c.__node_alloc())
|
1221
|
+
{
|
1222
|
+
typedef move_iterator<iterator> _Ip;
|
1223
|
+
assign(_Ip(__c.begin()), _Ip(__c.end()));
|
1224
|
+
}
|
1225
|
+
else
|
1226
|
+
__move_assign(__c, true_type());
|
1227
|
+
}
|
1228
|
+
|
1229
|
+
template <class _Tp, class _Alloc>
|
1230
|
+
void
|
1231
|
+
list<_Tp, _Alloc>::__move_assign(list& __c, true_type)
|
1232
|
+
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
|
1233
|
+
{
|
1234
|
+
clear();
|
1235
|
+
base::__move_assign_alloc(__c);
|
1236
|
+
splice(end(), __c);
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
1240
|
+
|
1241
|
+
template <class _Tp, class _Alloc>
|
1242
|
+
template <class _InpIter>
|
1243
|
+
void
|
1244
|
+
list<_Tp, _Alloc>::assign(_InpIter __f, _InpIter __l,
|
1245
|
+
typename enable_if<__is_input_iterator<_InpIter>::value>::type*)
|
1246
|
+
{
|
1247
|
+
iterator __i = begin();
|
1248
|
+
iterator __e = end();
|
1249
|
+
for (; __f != __l && __i != __e; ++__f, ++__i)
|
1250
|
+
*__i = *__f;
|
1251
|
+
if (__i == __e)
|
1252
|
+
insert(__e, __f, __l);
|
1253
|
+
else
|
1254
|
+
erase(__i, __e);
|
1255
|
+
}
|
1256
|
+
|
1257
|
+
template <class _Tp, class _Alloc>
|
1258
|
+
void
|
1259
|
+
list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x)
|
1260
|
+
{
|
1261
|
+
iterator __i = begin();
|
1262
|
+
iterator __e = end();
|
1263
|
+
for (; __n > 0 && __i != __e; --__n, ++__i)
|
1264
|
+
*__i = __x;
|
1265
|
+
if (__i == __e)
|
1266
|
+
insert(__e, __n, __x);
|
1267
|
+
else
|
1268
|
+
erase(__i, __e);
|
1269
|
+
}
|
1270
|
+
|
1271
|
+
template <class _Tp, class _Alloc>
|
1272
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
1273
|
+
_Alloc
|
1274
|
+
list<_Tp, _Alloc>::get_allocator() const _NOEXCEPT
|
1275
|
+
{
|
1276
|
+
return allocator_type(base::__node_alloc());
|
1277
|
+
}
|
1278
|
+
|
1279
|
+
template <class _Tp, class _Alloc>
|
1280
|
+
typename list<_Tp, _Alloc>::iterator
|
1281
|
+
list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
|
1282
|
+
{
|
1283
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1284
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
1285
|
+
"list::insert(iterator, x) called with an iterator not"
|
1286
|
+
" referring to this list");
|
1287
|
+
#endif
|
1288
|
+
__node_allocator& __na = base::__node_alloc();
|
1289
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1290
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1291
|
+
__hold->__prev_ = 0;
|
1292
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
1293
|
+
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
|
1294
|
+
++base::__sz();
|
1295
|
+
return iterator(__hold.release());
|
1296
|
+
}
|
1297
|
+
|
1298
|
+
template <class _Tp, class _Alloc>
|
1299
|
+
typename list<_Tp, _Alloc>::iterator
|
1300
|
+
list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& __x)
|
1301
|
+
{
|
1302
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1303
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
1304
|
+
"list::insert(iterator, n, x) called with an iterator not"
|
1305
|
+
" referring to this list");
|
1306
|
+
iterator __r(const_cast<__node_pointer>(__p.__ptr_), this);
|
1307
|
+
#else
|
1308
|
+
iterator __r(const_cast<__node_pointer>(__p.__ptr_));
|
1309
|
+
#endif
|
1310
|
+
if (__n > 0)
|
1311
|
+
{
|
1312
|
+
size_type __ds = 0;
|
1313
|
+
__node_allocator& __na = base::__node_alloc();
|
1314
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1315
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1316
|
+
__hold->__prev_ = 0;
|
1317
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
1318
|
+
++__ds;
|
1319
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1320
|
+
__r = iterator(__hold.get(), this);
|
1321
|
+
#else
|
1322
|
+
__r = iterator(__hold.get());
|
1323
|
+
#endif
|
1324
|
+
__hold.release();
|
1325
|
+
iterator __e = __r;
|
1326
|
+
#ifndef _LIBCPP_NO_EXCEPTIONS
|
1327
|
+
try
|
1328
|
+
{
|
1329
|
+
#endif // _LIBCPP_NO_EXCEPTIONS
|
1330
|
+
for (--__n; __n != 0; --__n, ++__e, ++__ds)
|
1331
|
+
{
|
1332
|
+
__hold.reset(__node_alloc_traits::allocate(__na, 1));
|
1333
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
1334
|
+
__e.__ptr_->__next_ = __hold.get();
|
1335
|
+
__hold->__prev_ = __e.__ptr_;
|
1336
|
+
__hold.release();
|
1337
|
+
}
|
1338
|
+
#ifndef _LIBCPP_NO_EXCEPTIONS
|
1339
|
+
}
|
1340
|
+
catch (...)
|
1341
|
+
{
|
1342
|
+
while (true)
|
1343
|
+
{
|
1344
|
+
__node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
|
1345
|
+
__node_pointer __prev = __e.__ptr_->__prev_;
|
1346
|
+
__node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
|
1347
|
+
if (__prev == 0)
|
1348
|
+
break;
|
1349
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1350
|
+
__e = iterator(__prev, this);
|
1351
|
+
#else
|
1352
|
+
__e = iterator(__prev);
|
1353
|
+
#endif
|
1354
|
+
}
|
1355
|
+
throw;
|
1356
|
+
}
|
1357
|
+
#endif // _LIBCPP_NO_EXCEPTIONS
|
1358
|
+
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__r.__ptr_, *__e.__ptr_);
|
1359
|
+
base::__sz() += __ds;
|
1360
|
+
}
|
1361
|
+
return __r;
|
1362
|
+
}
|
1363
|
+
|
1364
|
+
template <class _Tp, class _Alloc>
|
1365
|
+
template <class _InpIter>
|
1366
|
+
typename list<_Tp, _Alloc>::iterator
|
1367
|
+
list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
|
1368
|
+
typename enable_if<__is_input_iterator<_InpIter>::value>::type*)
|
1369
|
+
{
|
1370
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1371
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
1372
|
+
"list::insert(iterator, range) called with an iterator not"
|
1373
|
+
" referring to this list");
|
1374
|
+
iterator __r(const_cast<__node_pointer>(__p.__ptr_), this);
|
1375
|
+
#else
|
1376
|
+
iterator __r(const_cast<__node_pointer>(__p.__ptr_));
|
1377
|
+
#endif
|
1378
|
+
if (__f != __l)
|
1379
|
+
{
|
1380
|
+
size_type __ds = 0;
|
1381
|
+
__node_allocator& __na = base::__node_alloc();
|
1382
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1383
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1384
|
+
__hold->__prev_ = 0;
|
1385
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
|
1386
|
+
++__ds;
|
1387
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1388
|
+
__r = iterator(__hold.get(), this);
|
1389
|
+
#else
|
1390
|
+
__r = iterator(__hold.get());
|
1391
|
+
#endif
|
1392
|
+
__hold.release();
|
1393
|
+
iterator __e = __r;
|
1394
|
+
#ifndef _LIBCPP_NO_EXCEPTIONS
|
1395
|
+
try
|
1396
|
+
{
|
1397
|
+
#endif // _LIBCPP_NO_EXCEPTIONS
|
1398
|
+
for (++__f; __f != __l; ++__f, ++__e, ++__ds)
|
1399
|
+
{
|
1400
|
+
__hold.reset(__node_alloc_traits::allocate(__na, 1));
|
1401
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
|
1402
|
+
__e.__ptr_->__next_ = __hold.get();
|
1403
|
+
__hold->__prev_ = __e.__ptr_;
|
1404
|
+
__hold.release();
|
1405
|
+
}
|
1406
|
+
#ifndef _LIBCPP_NO_EXCEPTIONS
|
1407
|
+
}
|
1408
|
+
catch (...)
|
1409
|
+
{
|
1410
|
+
while (true)
|
1411
|
+
{
|
1412
|
+
__node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
|
1413
|
+
__node_pointer __prev = __e.__ptr_->__prev_;
|
1414
|
+
__node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
|
1415
|
+
if (__prev == 0)
|
1416
|
+
break;
|
1417
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1418
|
+
__e = iterator(__prev, this);
|
1419
|
+
#else
|
1420
|
+
__e = iterator(__prev);
|
1421
|
+
#endif
|
1422
|
+
}
|
1423
|
+
throw;
|
1424
|
+
}
|
1425
|
+
#endif // _LIBCPP_NO_EXCEPTIONS
|
1426
|
+
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__r.__ptr_, *__e.__ptr_);
|
1427
|
+
base::__sz() += __ds;
|
1428
|
+
}
|
1429
|
+
return __r;
|
1430
|
+
}
|
1431
|
+
|
1432
|
+
template <class _Tp, class _Alloc>
|
1433
|
+
void
|
1434
|
+
list<_Tp, _Alloc>::push_front(const value_type& __x)
|
1435
|
+
{
|
1436
|
+
__node_allocator& __na = base::__node_alloc();
|
1437
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1438
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1439
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
1440
|
+
__link_nodes(*base::__end_.__next_, *__hold, *__hold);
|
1441
|
+
++base::__sz();
|
1442
|
+
__hold.release();
|
1443
|
+
}
|
1444
|
+
|
1445
|
+
template <class _Tp, class _Alloc>
|
1446
|
+
void
|
1447
|
+
list<_Tp, _Alloc>::push_back(const value_type& __x)
|
1448
|
+
{
|
1449
|
+
__node_allocator& __na = base::__node_alloc();
|
1450
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1451
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1452
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
1453
|
+
__link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
|
1454
|
+
++base::__sz();
|
1455
|
+
__hold.release();
|
1456
|
+
}
|
1457
|
+
|
1458
|
+
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
1459
|
+
|
1460
|
+
template <class _Tp, class _Alloc>
|
1461
|
+
void
|
1462
|
+
list<_Tp, _Alloc>::push_front(value_type&& __x)
|
1463
|
+
{
|
1464
|
+
__node_allocator& __na = base::__node_alloc();
|
1465
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1466
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1467
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
|
1468
|
+
__link_nodes(*base::__end_.__next_, *__hold, *__hold);
|
1469
|
+
++base::__sz();
|
1470
|
+
__hold.release();
|
1471
|
+
}
|
1472
|
+
|
1473
|
+
template <class _Tp, class _Alloc>
|
1474
|
+
void
|
1475
|
+
list<_Tp, _Alloc>::push_back(value_type&& __x)
|
1476
|
+
{
|
1477
|
+
__node_allocator& __na = base::__node_alloc();
|
1478
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1479
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1480
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
|
1481
|
+
__link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
|
1482
|
+
++base::__sz();
|
1483
|
+
__hold.release();
|
1484
|
+
}
|
1485
|
+
|
1486
|
+
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
1487
|
+
|
1488
|
+
template <class _Tp, class _Alloc>
|
1489
|
+
template <class... _Args>
|
1490
|
+
void
|
1491
|
+
list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
|
1492
|
+
{
|
1493
|
+
__node_allocator& __na = base::__node_alloc();
|
1494
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1495
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1496
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
|
1497
|
+
__link_nodes(*base::__end_.__next_, *__hold, *__hold);
|
1498
|
+
++base::__sz();
|
1499
|
+
__hold.release();
|
1500
|
+
}
|
1501
|
+
|
1502
|
+
template <class _Tp, class _Alloc>
|
1503
|
+
template <class... _Args>
|
1504
|
+
void
|
1505
|
+
list<_Tp, _Alloc>::emplace_back(_Args&&... __args)
|
1506
|
+
{
|
1507
|
+
__node_allocator& __na = base::__node_alloc();
|
1508
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1509
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1510
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
|
1511
|
+
__link_nodes(static_cast<__node&>(base::__end_), *__hold, *__hold);
|
1512
|
+
++base::__sz();
|
1513
|
+
__hold.release();
|
1514
|
+
}
|
1515
|
+
|
1516
|
+
template <class _Tp, class _Alloc>
|
1517
|
+
template <class... _Args>
|
1518
|
+
typename list<_Tp, _Alloc>::iterator
|
1519
|
+
list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
|
1520
|
+
{
|
1521
|
+
__node_allocator& __na = base::__node_alloc();
|
1522
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1523
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1524
|
+
__hold->__prev_ = 0;
|
1525
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
|
1526
|
+
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
|
1527
|
+
++base::__sz();
|
1528
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1529
|
+
return iterator(__hold.release(), this);
|
1530
|
+
#else
|
1531
|
+
return iterator(__hold.release());
|
1532
|
+
#endif
|
1533
|
+
}
|
1534
|
+
|
1535
|
+
#endif // _LIBCPP_HAS_NO_VARIADICS
|
1536
|
+
|
1537
|
+
template <class _Tp, class _Alloc>
|
1538
|
+
typename list<_Tp, _Alloc>::iterator
|
1539
|
+
list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
|
1540
|
+
{
|
1541
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1542
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
1543
|
+
"list::insert(iterator, x) called with an iterator not"
|
1544
|
+
" referring to this list");
|
1545
|
+
#endif
|
1546
|
+
__node_allocator& __na = base::__node_alloc();
|
1547
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1548
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1549
|
+
__hold->__prev_ = 0;
|
1550
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
|
1551
|
+
__link_nodes(const_cast<__node&>(*__p.__ptr_), *__hold, *__hold);
|
1552
|
+
++base::__sz();
|
1553
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1554
|
+
return iterator(__hold.release(), this);
|
1555
|
+
#else
|
1556
|
+
return iterator(__hold.release());
|
1557
|
+
#endif
|
1558
|
+
}
|
1559
|
+
|
1560
|
+
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
1561
|
+
|
1562
|
+
template <class _Tp, class _Alloc>
|
1563
|
+
void
|
1564
|
+
list<_Tp, _Alloc>::pop_front()
|
1565
|
+
{
|
1566
|
+
_LIBCPP_ASSERT(!empty(), "list::pop_front() called with empty list");
|
1567
|
+
__node_allocator& __na = base::__node_alloc();
|
1568
|
+
__node& __n = *base::__end_.__next_;
|
1569
|
+
base::__unlink_nodes(__n, __n);
|
1570
|
+
--base::__sz();
|
1571
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1572
|
+
__c_node* __c = __get_db()->__find_c_and_lock(this);
|
1573
|
+
for (__i_node** __p = __c->end_; __p != __c->beg_; )
|
1574
|
+
{
|
1575
|
+
--__p;
|
1576
|
+
iterator* __i = static_cast<iterator*>((*__p)->__i_);
|
1577
|
+
if (__i->__ptr_ == &__n)
|
1578
|
+
{
|
1579
|
+
(*__p)->__c_ = nullptr;
|
1580
|
+
if (--__c->end_ != __p)
|
1581
|
+
memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
|
1582
|
+
}
|
1583
|
+
}
|
1584
|
+
__get_db()->unlock();
|
1585
|
+
#endif
|
1586
|
+
__node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
|
1587
|
+
__node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
template <class _Tp, class _Alloc>
|
1591
|
+
void
|
1592
|
+
list<_Tp, _Alloc>::pop_back()
|
1593
|
+
{
|
1594
|
+
_LIBCPP_ASSERT(!empty(), "list::pop_front() called with empty list");
|
1595
|
+
__node_allocator& __na = base::__node_alloc();
|
1596
|
+
__node& __n = *base::__end_.__prev_;
|
1597
|
+
base::__unlink_nodes(__n, __n);
|
1598
|
+
--base::__sz();
|
1599
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1600
|
+
__c_node* __c = __get_db()->__find_c_and_lock(this);
|
1601
|
+
for (__i_node** __p = __c->end_; __p != __c->beg_; )
|
1602
|
+
{
|
1603
|
+
--__p;
|
1604
|
+
iterator* __i = static_cast<iterator*>((*__p)->__i_);
|
1605
|
+
if (__i->__ptr_ == &__n)
|
1606
|
+
{
|
1607
|
+
(*__p)->__c_ = nullptr;
|
1608
|
+
if (--__c->end_ != __p)
|
1609
|
+
memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
|
1610
|
+
}
|
1611
|
+
}
|
1612
|
+
__get_db()->unlock();
|
1613
|
+
#endif
|
1614
|
+
__node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
|
1615
|
+
__node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
|
1616
|
+
}
|
1617
|
+
|
1618
|
+
template <class _Tp, class _Alloc>
|
1619
|
+
typename list<_Tp, _Alloc>::iterator
|
1620
|
+
list<_Tp, _Alloc>::erase(const_iterator __p)
|
1621
|
+
{
|
1622
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1623
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
1624
|
+
"list::erase(iterator) called with an iterator not"
|
1625
|
+
" referring to this list");
|
1626
|
+
#endif
|
1627
|
+
__node_allocator& __na = base::__node_alloc();
|
1628
|
+
__node& __n = const_cast<__node&>(*__p.__ptr_);
|
1629
|
+
__node_pointer __r = __n.__next_;
|
1630
|
+
base::__unlink_nodes(__n, __n);
|
1631
|
+
--base::__sz();
|
1632
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1633
|
+
__c_node* __c = __get_db()->__find_c_and_lock(this);
|
1634
|
+
for (__i_node** __p = __c->end_; __p != __c->beg_; )
|
1635
|
+
{
|
1636
|
+
--__p;
|
1637
|
+
iterator* __i = static_cast<iterator*>((*__p)->__i_);
|
1638
|
+
if (__i->__ptr_ == &__n)
|
1639
|
+
{
|
1640
|
+
(*__p)->__c_ = nullptr;
|
1641
|
+
if (--__c->end_ != __p)
|
1642
|
+
memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
|
1643
|
+
}
|
1644
|
+
}
|
1645
|
+
__get_db()->unlock();
|
1646
|
+
#endif
|
1647
|
+
__node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
|
1648
|
+
__node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
|
1649
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1650
|
+
return iterator(__r, this);
|
1651
|
+
#else
|
1652
|
+
return iterator(__r);
|
1653
|
+
#endif
|
1654
|
+
}
|
1655
|
+
|
1656
|
+
template <class _Tp, class _Alloc>
|
1657
|
+
typename list<_Tp, _Alloc>::iterator
|
1658
|
+
list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
|
1659
|
+
{
|
1660
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1661
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this,
|
1662
|
+
"list::erase(iterator, iterator) called with an iterator not"
|
1663
|
+
" referring to this list");
|
1664
|
+
#endif
|
1665
|
+
if (__f != __l)
|
1666
|
+
{
|
1667
|
+
__node_allocator& __na = base::__node_alloc();
|
1668
|
+
base::__unlink_nodes(const_cast<__node&>(*__f.__ptr_), *__l.__ptr_->__prev_);
|
1669
|
+
while (__f != __l)
|
1670
|
+
{
|
1671
|
+
__node& __n = const_cast<__node&>(*__f.__ptr_);
|
1672
|
+
++__f;
|
1673
|
+
--base::__sz();
|
1674
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1675
|
+
__c_node* __c = __get_db()->__find_c_and_lock(this);
|
1676
|
+
for (__i_node** __p = __c->end_; __p != __c->beg_; )
|
1677
|
+
{
|
1678
|
+
--__p;
|
1679
|
+
iterator* __i = static_cast<iterator*>((*__p)->__i_);
|
1680
|
+
if (__i->__ptr_ == &__n)
|
1681
|
+
{
|
1682
|
+
(*__p)->__c_ = nullptr;
|
1683
|
+
if (--__c->end_ != __p)
|
1684
|
+
memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
|
1685
|
+
}
|
1686
|
+
}
|
1687
|
+
__get_db()->unlock();
|
1688
|
+
#endif
|
1689
|
+
__node_alloc_traits::destroy(__na, _VSTD::addressof(__n.__value_));
|
1690
|
+
__node_alloc_traits::deallocate(__na, _VSTD::addressof(__n), 1);
|
1691
|
+
}
|
1692
|
+
}
|
1693
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1694
|
+
return iterator(const_cast<__node_pointer>(__l.__ptr_), this);
|
1695
|
+
#else
|
1696
|
+
return iterator(const_cast<__node_pointer>(__l.__ptr_));
|
1697
|
+
#endif
|
1698
|
+
}
|
1699
|
+
|
1700
|
+
template <class _Tp, class _Alloc>
|
1701
|
+
void
|
1702
|
+
list<_Tp, _Alloc>::resize(size_type __n)
|
1703
|
+
{
|
1704
|
+
if (__n < base::__sz())
|
1705
|
+
erase(__iterator(__n), end());
|
1706
|
+
else if (__n > base::__sz())
|
1707
|
+
{
|
1708
|
+
__n -= base::__sz();
|
1709
|
+
size_type __ds = 0;
|
1710
|
+
__node_allocator& __na = base::__node_alloc();
|
1711
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1712
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1713
|
+
__hold->__prev_ = 0;
|
1714
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
|
1715
|
+
++__ds;
|
1716
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1717
|
+
iterator __r = iterator(__hold.release(), this);
|
1718
|
+
#else
|
1719
|
+
iterator __r = iterator(__hold.release());
|
1720
|
+
#endif
|
1721
|
+
iterator __e = __r;
|
1722
|
+
#ifndef _LIBCPP_NO_EXCEPTIONS
|
1723
|
+
try
|
1724
|
+
{
|
1725
|
+
#endif // _LIBCPP_NO_EXCEPTIONS
|
1726
|
+
for (--__n; __n != 0; --__n, ++__e, ++__ds)
|
1727
|
+
{
|
1728
|
+
__hold.reset(__node_alloc_traits::allocate(__na, 1));
|
1729
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
|
1730
|
+
__e.__ptr_->__next_ = __hold.get();
|
1731
|
+
__hold->__prev_ = __e.__ptr_;
|
1732
|
+
__hold.release();
|
1733
|
+
}
|
1734
|
+
#ifndef _LIBCPP_NO_EXCEPTIONS
|
1735
|
+
}
|
1736
|
+
catch (...)
|
1737
|
+
{
|
1738
|
+
while (true)
|
1739
|
+
{
|
1740
|
+
__node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
|
1741
|
+
__node_pointer __prev = __e.__ptr_->__prev_;
|
1742
|
+
__node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
|
1743
|
+
if (__prev == 0)
|
1744
|
+
break;
|
1745
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1746
|
+
__e = iterator(__prev, this);
|
1747
|
+
#else
|
1748
|
+
__e = iterator(__prev);
|
1749
|
+
#endif
|
1750
|
+
}
|
1751
|
+
throw;
|
1752
|
+
}
|
1753
|
+
#endif // _LIBCPP_NO_EXCEPTIONS
|
1754
|
+
__link_nodes(static_cast<__node&>(base::__end_), *__r.__ptr_, *__e.__ptr_);
|
1755
|
+
base::__sz() += __ds;
|
1756
|
+
}
|
1757
|
+
}
|
1758
|
+
|
1759
|
+
template <class _Tp, class _Alloc>
|
1760
|
+
void
|
1761
|
+
list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
|
1762
|
+
{
|
1763
|
+
if (__n < base::__sz())
|
1764
|
+
erase(__iterator(__n), end());
|
1765
|
+
else if (__n > base::__sz())
|
1766
|
+
{
|
1767
|
+
__n -= base::__sz();
|
1768
|
+
size_type __ds = 0;
|
1769
|
+
__node_allocator& __na = base::__node_alloc();
|
1770
|
+
typedef __allocator_destructor<__node_allocator> _Dp;
|
1771
|
+
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
1772
|
+
__hold->__prev_ = 0;
|
1773
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
1774
|
+
++__ds;
|
1775
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1776
|
+
iterator __r = iterator(__hold.release(), this);
|
1777
|
+
#else
|
1778
|
+
iterator __r = iterator(__hold.release());
|
1779
|
+
#endif
|
1780
|
+
iterator __e = __r;
|
1781
|
+
#ifndef _LIBCPP_NO_EXCEPTIONS
|
1782
|
+
try
|
1783
|
+
{
|
1784
|
+
#endif // _LIBCPP_NO_EXCEPTIONS
|
1785
|
+
for (--__n; __n != 0; --__n, ++__e, ++__ds)
|
1786
|
+
{
|
1787
|
+
__hold.reset(__node_alloc_traits::allocate(__na, 1));
|
1788
|
+
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
1789
|
+
__e.__ptr_->__next_ = __hold.get();
|
1790
|
+
__hold->__prev_ = __e.__ptr_;
|
1791
|
+
__hold.release();
|
1792
|
+
}
|
1793
|
+
#ifndef _LIBCPP_NO_EXCEPTIONS
|
1794
|
+
}
|
1795
|
+
catch (...)
|
1796
|
+
{
|
1797
|
+
while (true)
|
1798
|
+
{
|
1799
|
+
__node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
|
1800
|
+
__node_pointer __prev = __e.__ptr_->__prev_;
|
1801
|
+
__node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
|
1802
|
+
if (__prev == 0)
|
1803
|
+
break;
|
1804
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1805
|
+
__e = iterator(__prev, this);
|
1806
|
+
#else
|
1807
|
+
__e = iterator(__prev);
|
1808
|
+
#endif
|
1809
|
+
}
|
1810
|
+
throw;
|
1811
|
+
}
|
1812
|
+
#endif // _LIBCPP_NO_EXCEPTIONS
|
1813
|
+
__link_nodes(static_cast<__node&>(base::__end_), *__r.__ptr_, *__e.__ptr_);
|
1814
|
+
base::__sz() += __ds;
|
1815
|
+
}
|
1816
|
+
}
|
1817
|
+
|
1818
|
+
template <class _Tp, class _Alloc>
|
1819
|
+
void
|
1820
|
+
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
|
1821
|
+
{
|
1822
|
+
_LIBCPP_ASSERT(this != &__c,
|
1823
|
+
"list::splice(iterator, list) called with this == &list");
|
1824
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1825
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
1826
|
+
"list::splice(iterator, list) called with an iterator not"
|
1827
|
+
" referring to this list");
|
1828
|
+
#endif
|
1829
|
+
if (!__c.empty())
|
1830
|
+
{
|
1831
|
+
__node& __f = *__c.__end_.__next_;
|
1832
|
+
__node& __l = *__c.__end_.__prev_;
|
1833
|
+
base::__unlink_nodes(__f, __l);
|
1834
|
+
__link_nodes(const_cast<__node&>(*__p.__ptr_), __f, __l);
|
1835
|
+
base::__sz() += __c.__sz();
|
1836
|
+
__c.__sz() = 0;
|
1837
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1838
|
+
__libcpp_db* __db = __get_db();
|
1839
|
+
__c_node* __cn1 = __db->__find_c_and_lock(this);
|
1840
|
+
__c_node* __cn2 = __db->__find_c(&__c);
|
1841
|
+
for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
|
1842
|
+
{
|
1843
|
+
--__p;
|
1844
|
+
iterator* __i = static_cast<iterator*>((*__p)->__i_);
|
1845
|
+
if (__i->__ptr_ != static_cast<__node_pointer>(&__c.__end_))
|
1846
|
+
{
|
1847
|
+
__cn1->__add(*__p);
|
1848
|
+
(*__p)->__c_ = __cn1;
|
1849
|
+
if (--__cn2->end_ != __p)
|
1850
|
+
memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
|
1851
|
+
}
|
1852
|
+
}
|
1853
|
+
__db->unlock();
|
1854
|
+
#endif
|
1855
|
+
}
|
1856
|
+
}
|
1857
|
+
|
1858
|
+
template <class _Tp, class _Alloc>
|
1859
|
+
void
|
1860
|
+
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
|
1861
|
+
{
|
1862
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1863
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
1864
|
+
"list::splice(iterator, list, iterator) called with first iterator not"
|
1865
|
+
" referring to this list");
|
1866
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__i) == &__c,
|
1867
|
+
"list::splice(iterator, list, iterator) called with second iterator not"
|
1868
|
+
" referring to list argument");
|
1869
|
+
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i),
|
1870
|
+
"list::splice(iterator, list, iterator) called with second iterator not"
|
1871
|
+
" derefereceable");
|
1872
|
+
#endif
|
1873
|
+
if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
|
1874
|
+
{
|
1875
|
+
__node& __f = const_cast<__node&>(*__i.__ptr_);
|
1876
|
+
base::__unlink_nodes(__f, __f);
|
1877
|
+
__link_nodes(const_cast<__node&>(*__p.__ptr_), __f, __f);
|
1878
|
+
--__c.__sz();
|
1879
|
+
++base::__sz();
|
1880
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1881
|
+
__libcpp_db* __db = __get_db();
|
1882
|
+
__c_node* __cn1 = __db->__find_c_and_lock(this);
|
1883
|
+
__c_node* __cn2 = __db->__find_c(&__c);
|
1884
|
+
for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
|
1885
|
+
{
|
1886
|
+
--__p;
|
1887
|
+
iterator* __j = static_cast<iterator*>((*__p)->__i_);
|
1888
|
+
if (__j->__ptr_ == &__f)
|
1889
|
+
{
|
1890
|
+
__cn1->__add(*__p);
|
1891
|
+
(*__p)->__c_ = __cn1;
|
1892
|
+
if (--__cn2->end_ != __p)
|
1893
|
+
memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
|
1894
|
+
}
|
1895
|
+
}
|
1896
|
+
__db->unlock();
|
1897
|
+
#endif
|
1898
|
+
}
|
1899
|
+
}
|
1900
|
+
|
1901
|
+
template <class _Tp, class _Alloc>
|
1902
|
+
void
|
1903
|
+
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l)
|
1904
|
+
{
|
1905
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1906
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
|
1907
|
+
"list::splice(iterator, list, iterator, iterator) called with first iterator not"
|
1908
|
+
" referring to this list");
|
1909
|
+
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == &__c,
|
1910
|
+
"list::splice(iterator, list, iterator, iterator) called with second iterator not"
|
1911
|
+
" referring to list argument");
|
1912
|
+
if (this == &__c)
|
1913
|
+
{
|
1914
|
+
for (const_iterator __i = __f; __i != __l; ++__i)
|
1915
|
+
_LIBCPP_ASSERT(__i != __p,
|
1916
|
+
"list::splice(iterator, list, iterator, iterator)"
|
1917
|
+
" called with the first iterator within the range"
|
1918
|
+
" of the second and third iterators");
|
1919
|
+
}
|
1920
|
+
#endif
|
1921
|
+
if (__f != __l)
|
1922
|
+
{
|
1923
|
+
if (this != &__c)
|
1924
|
+
{
|
1925
|
+
size_type __s = _VSTD::distance(__f, __l);
|
1926
|
+
__c.__sz() -= __s;
|
1927
|
+
base::__sz() += __s;
|
1928
|
+
}
|
1929
|
+
__node& __first = const_cast<__node&>(*__f.__ptr_);
|
1930
|
+
--__l;
|
1931
|
+
__node& __last = const_cast<__node&>(*__l.__ptr_);
|
1932
|
+
base::__unlink_nodes(__first, __last);
|
1933
|
+
__link_nodes(const_cast<__node&>(*__p.__ptr_), __first, __last);
|
1934
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
1935
|
+
__libcpp_db* __db = __get_db();
|
1936
|
+
__c_node* __cn1 = __db->__find_c_and_lock(this);
|
1937
|
+
__c_node* __cn2 = __db->__find_c(&__c);
|
1938
|
+
for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
|
1939
|
+
{
|
1940
|
+
--__p;
|
1941
|
+
iterator* __j = static_cast<iterator*>((*__p)->__i_);
|
1942
|
+
for (__node_pointer __k = const_cast<__node_pointer>(__f.__ptr_);
|
1943
|
+
__k != __l.__ptr_; __k = __k->__next_)
|
1944
|
+
{
|
1945
|
+
if (__j->__ptr_ == __k)
|
1946
|
+
{
|
1947
|
+
__cn1->__add(*__p);
|
1948
|
+
(*__p)->__c_ = __cn1;
|
1949
|
+
if (--__cn2->end_ != __p)
|
1950
|
+
memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
|
1951
|
+
}
|
1952
|
+
}
|
1953
|
+
}
|
1954
|
+
__db->unlock();
|
1955
|
+
#endif
|
1956
|
+
}
|
1957
|
+
}
|
1958
|
+
|
1959
|
+
template <class _Tp, class _Alloc>
|
1960
|
+
void
|
1961
|
+
list<_Tp, _Alloc>::remove(const value_type& __x)
|
1962
|
+
{
|
1963
|
+
for (iterator __i = begin(), __e = end(); __i != __e;)
|
1964
|
+
{
|
1965
|
+
if (*__i == __x)
|
1966
|
+
{
|
1967
|
+
iterator __j = _VSTD::next(__i);
|
1968
|
+
for (; __j != __e && *__j == __x; ++__j)
|
1969
|
+
;
|
1970
|
+
__i = erase(__i, __j);
|
1971
|
+
}
|
1972
|
+
else
|
1973
|
+
++__i;
|
1974
|
+
}
|
1975
|
+
}
|
1976
|
+
|
1977
|
+
template <class _Tp, class _Alloc>
|
1978
|
+
template <class _Pred>
|
1979
|
+
void
|
1980
|
+
list<_Tp, _Alloc>::remove_if(_Pred __pred)
|
1981
|
+
{
|
1982
|
+
for (iterator __i = begin(), __e = end(); __i != __e;)
|
1983
|
+
{
|
1984
|
+
if (__pred(*__i))
|
1985
|
+
{
|
1986
|
+
iterator __j = _VSTD::next(__i);
|
1987
|
+
for (; __j != __e && __pred(*__j); ++__j)
|
1988
|
+
;
|
1989
|
+
__i = erase(__i, __j);
|
1990
|
+
}
|
1991
|
+
else
|
1992
|
+
++__i;
|
1993
|
+
}
|
1994
|
+
}
|
1995
|
+
|
1996
|
+
template <class _Tp, class _Alloc>
|
1997
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
1998
|
+
void
|
1999
|
+
list<_Tp, _Alloc>::unique()
|
2000
|
+
{
|
2001
|
+
unique(__equal_to<value_type>());
|
2002
|
+
}
|
2003
|
+
|
2004
|
+
template <class _Tp, class _Alloc>
|
2005
|
+
template <class _BinaryPred>
|
2006
|
+
void
|
2007
|
+
list<_Tp, _Alloc>::unique(_BinaryPred __binary_pred)
|
2008
|
+
{
|
2009
|
+
for (iterator __i = begin(), __e = end(); __i != __e;)
|
2010
|
+
{
|
2011
|
+
iterator __j = _VSTD::next(__i);
|
2012
|
+
for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
|
2013
|
+
;
|
2014
|
+
if (++__i != __j)
|
2015
|
+
__i = erase(__i, __j);
|
2016
|
+
}
|
2017
|
+
}
|
2018
|
+
|
2019
|
+
template <class _Tp, class _Alloc>
|
2020
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2021
|
+
void
|
2022
|
+
list<_Tp, _Alloc>::merge(list& __c)
|
2023
|
+
{
|
2024
|
+
merge(__c, __less<value_type>());
|
2025
|
+
}
|
2026
|
+
|
2027
|
+
template <class _Tp, class _Alloc>
|
2028
|
+
template <class _Comp>
|
2029
|
+
void
|
2030
|
+
list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
|
2031
|
+
{
|
2032
|
+
if (this != &__c)
|
2033
|
+
{
|
2034
|
+
iterator __f1 = begin();
|
2035
|
+
iterator __e1 = end();
|
2036
|
+
iterator __f2 = __c.begin();
|
2037
|
+
iterator __e2 = __c.end();
|
2038
|
+
while (__f1 != __e1 && __f2 != __e2)
|
2039
|
+
{
|
2040
|
+
if (__comp(*__f2, *__f1))
|
2041
|
+
{
|
2042
|
+
size_type __ds = 1;
|
2043
|
+
iterator __m2 = _VSTD::next(__f2);
|
2044
|
+
for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2, ++__ds)
|
2045
|
+
;
|
2046
|
+
base::__sz() += __ds;
|
2047
|
+
__c.__sz() -= __ds;
|
2048
|
+
__node& __f = *__f2.__ptr_;
|
2049
|
+
__node& __l = *__m2.__ptr_->__prev_;
|
2050
|
+
__f2 = __m2;
|
2051
|
+
base::__unlink_nodes(__f, __l);
|
2052
|
+
__m2 = _VSTD::next(__f1);
|
2053
|
+
__link_nodes(*__f1.__ptr_, __f, __l);
|
2054
|
+
__f1 = __m2;
|
2055
|
+
}
|
2056
|
+
else
|
2057
|
+
++__f1;
|
2058
|
+
}
|
2059
|
+
splice(__e1, __c);
|
2060
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
2061
|
+
__libcpp_db* __db = __get_db();
|
2062
|
+
__c_node* __cn1 = __db->__find_c_and_lock(this);
|
2063
|
+
__c_node* __cn2 = __db->__find_c(&__c);
|
2064
|
+
for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
|
2065
|
+
{
|
2066
|
+
--__p;
|
2067
|
+
iterator* __i = static_cast<iterator*>((*__p)->__i_);
|
2068
|
+
if (__i->__ptr_ != static_cast<__node_pointer>(&__c.__end_))
|
2069
|
+
{
|
2070
|
+
__cn1->__add(*__p);
|
2071
|
+
(*__p)->__c_ = __cn1;
|
2072
|
+
if (--__cn2->end_ != __p)
|
2073
|
+
memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
|
2074
|
+
}
|
2075
|
+
}
|
2076
|
+
__db->unlock();
|
2077
|
+
#endif
|
2078
|
+
}
|
2079
|
+
}
|
2080
|
+
|
2081
|
+
template <class _Tp, class _Alloc>
|
2082
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2083
|
+
void
|
2084
|
+
list<_Tp, _Alloc>::sort()
|
2085
|
+
{
|
2086
|
+
sort(__less<value_type>());
|
2087
|
+
}
|
2088
|
+
|
2089
|
+
template <class _Tp, class _Alloc>
|
2090
|
+
template <class _Comp>
|
2091
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2092
|
+
void
|
2093
|
+
list<_Tp, _Alloc>::sort(_Comp __comp)
|
2094
|
+
{
|
2095
|
+
__sort(begin(), end(), base::__sz(), __comp);
|
2096
|
+
}
|
2097
|
+
|
2098
|
+
template <class _Tp, class _Alloc>
|
2099
|
+
template <class _Comp>
|
2100
|
+
typename list<_Tp, _Alloc>::iterator
|
2101
|
+
list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp)
|
2102
|
+
{
|
2103
|
+
switch (__n)
|
2104
|
+
{
|
2105
|
+
case 0:
|
2106
|
+
case 1:
|
2107
|
+
return __f1;
|
2108
|
+
case 2:
|
2109
|
+
if (__comp(*--__e2, *__f1))
|
2110
|
+
{
|
2111
|
+
__node& __f = *__e2.__ptr_;
|
2112
|
+
base::__unlink_nodes(__f, __f);
|
2113
|
+
__link_nodes(*__f1.__ptr_, __f, __f);
|
2114
|
+
return __e2;
|
2115
|
+
}
|
2116
|
+
return __f1;
|
2117
|
+
}
|
2118
|
+
size_type __n2 = __n / 2;
|
2119
|
+
iterator __e1 = _VSTD::next(__f1, __n2);
|
2120
|
+
iterator __r = __f1 = __sort(__f1, __e1, __n2, __comp);
|
2121
|
+
iterator __f2 = __e1 = __sort(__e1, __e2, __n - __n2, __comp);
|
2122
|
+
if (__comp(*__f2, *__f1))
|
2123
|
+
{
|
2124
|
+
iterator __m2 = _VSTD::next(__f2);
|
2125
|
+
for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
|
2126
|
+
;
|
2127
|
+
__node& __f = *__f2.__ptr_;
|
2128
|
+
__node& __l = *__m2.__ptr_->__prev_;
|
2129
|
+
__r = __f2;
|
2130
|
+
__e1 = __f2 = __m2;
|
2131
|
+
base::__unlink_nodes(__f, __l);
|
2132
|
+
__m2 = _VSTD::next(__f1);
|
2133
|
+
__link_nodes(*__f1.__ptr_, __f, __l);
|
2134
|
+
__f1 = __m2;
|
2135
|
+
}
|
2136
|
+
else
|
2137
|
+
++__f1;
|
2138
|
+
while (__f1 != __e1 && __f2 != __e2)
|
2139
|
+
{
|
2140
|
+
if (__comp(*__f2, *__f1))
|
2141
|
+
{
|
2142
|
+
iterator __m2 = _VSTD::next(__f2);
|
2143
|
+
for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
|
2144
|
+
;
|
2145
|
+
__node& __f = *__f2.__ptr_;
|
2146
|
+
__node& __l = *__m2.__ptr_->__prev_;
|
2147
|
+
if (__e1 == __f2)
|
2148
|
+
__e1 = __m2;
|
2149
|
+
__f2 = __m2;
|
2150
|
+
base::__unlink_nodes(__f, __l);
|
2151
|
+
__m2 = _VSTD::next(__f1);
|
2152
|
+
__link_nodes(*__f1.__ptr_, __f, __l);
|
2153
|
+
__f1 = __m2;
|
2154
|
+
}
|
2155
|
+
else
|
2156
|
+
++__f1;
|
2157
|
+
}
|
2158
|
+
return __r;
|
2159
|
+
}
|
2160
|
+
|
2161
|
+
template <class _Tp, class _Alloc>
|
2162
|
+
void
|
2163
|
+
list<_Tp, _Alloc>::reverse() _NOEXCEPT
|
2164
|
+
{
|
2165
|
+
if (base::__sz() > 1)
|
2166
|
+
{
|
2167
|
+
iterator __e = end();
|
2168
|
+
for (iterator __i = begin(); __i.__ptr_ != __e.__ptr_;)
|
2169
|
+
{
|
2170
|
+
_VSTD::swap(__i.__ptr_->__prev_, __i.__ptr_->__next_);
|
2171
|
+
__i.__ptr_ = __i.__ptr_->__prev_;
|
2172
|
+
}
|
2173
|
+
_VSTD::swap(__e.__ptr_->__prev_, __e.__ptr_->__next_);
|
2174
|
+
}
|
2175
|
+
}
|
2176
|
+
|
2177
|
+
template <class _Tp, class _Alloc>
|
2178
|
+
bool
|
2179
|
+
list<_Tp, _Alloc>::__invariants() const
|
2180
|
+
{
|
2181
|
+
return size() == _VSTD::distance(begin(), end());
|
2182
|
+
}
|
2183
|
+
|
2184
|
+
#if _LIBCPP_DEBUG_LEVEL >= 2
|
2185
|
+
|
2186
|
+
template <class _Tp, class _Alloc>
|
2187
|
+
bool
|
2188
|
+
list<_Tp, _Alloc>::__dereferenceable(const const_iterator* __i) const
|
2189
|
+
{
|
2190
|
+
return __i->__ptr_ != &this->__end_;
|
2191
|
+
}
|
2192
|
+
|
2193
|
+
template <class _Tp, class _Alloc>
|
2194
|
+
bool
|
2195
|
+
list<_Tp, _Alloc>::__decrementable(const const_iterator* __i) const
|
2196
|
+
{
|
2197
|
+
return !empty() && __i->__ptr_ != base::__end_.__next_;
|
2198
|
+
}
|
2199
|
+
|
2200
|
+
template <class _Tp, class _Alloc>
|
2201
|
+
bool
|
2202
|
+
list<_Tp, _Alloc>::__addable(const const_iterator* __i, ptrdiff_t __n) const
|
2203
|
+
{
|
2204
|
+
return false;
|
2205
|
+
}
|
2206
|
+
|
2207
|
+
template <class _Tp, class _Alloc>
|
2208
|
+
bool
|
2209
|
+
list<_Tp, _Alloc>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const
|
2210
|
+
{
|
2211
|
+
return false;
|
2212
|
+
}
|
2213
|
+
|
2214
|
+
#endif // _LIBCPP_DEBUG_LEVEL >= 2
|
2215
|
+
|
2216
|
+
template <class _Tp, class _Alloc>
|
2217
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2218
|
+
bool
|
2219
|
+
operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
2220
|
+
{
|
2221
|
+
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
|
2222
|
+
}
|
2223
|
+
|
2224
|
+
template <class _Tp, class _Alloc>
|
2225
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2226
|
+
bool
|
2227
|
+
operator< (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
2228
|
+
{
|
2229
|
+
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
|
2230
|
+
}
|
2231
|
+
|
2232
|
+
template <class _Tp, class _Alloc>
|
2233
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2234
|
+
bool
|
2235
|
+
operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
2236
|
+
{
|
2237
|
+
return !(__x == __y);
|
2238
|
+
}
|
2239
|
+
|
2240
|
+
template <class _Tp, class _Alloc>
|
2241
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2242
|
+
bool
|
2243
|
+
operator> (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
2244
|
+
{
|
2245
|
+
return __y < __x;
|
2246
|
+
}
|
2247
|
+
|
2248
|
+
template <class _Tp, class _Alloc>
|
2249
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2250
|
+
bool
|
2251
|
+
operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
2252
|
+
{
|
2253
|
+
return !(__x < __y);
|
2254
|
+
}
|
2255
|
+
|
2256
|
+
template <class _Tp, class _Alloc>
|
2257
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2258
|
+
bool
|
2259
|
+
operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
|
2260
|
+
{
|
2261
|
+
return !(__y < __x);
|
2262
|
+
}
|
2263
|
+
|
2264
|
+
template <class _Tp, class _Alloc>
|
2265
|
+
inline _LIBCPP_INLINE_VISIBILITY
|
2266
|
+
void
|
2267
|
+
swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
|
2268
|
+
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
|
2269
|
+
{
|
2270
|
+
__x.swap(__y);
|
2271
|
+
}
|
2272
|
+
|
2273
|
+
_LIBCPP_END_NAMESPACE_STD
|
2274
|
+
|
2275
|
+
#endif // _LIBCPP_LIST
|