autodoc.xml 2.0 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230
  1. <?xml version="1.0" standalone="yes"?>
  2. <library-reference><header name="boost/intrusive/any_hook.hpp">
  3. <namespace name="boost">
  4. <namespace name="intrusive">
  5. <class name="any_base_hook"><template>
  6. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  7. </template><inherit access="public">make_any_base_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Derive a class from this hook in order to store objects of that class in an intrusive container.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::any_base_hook">any_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::any_base_hook">any_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
  8. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>container::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  9. </method-group>
  10. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  11. <constructor><parameter name=""><paramtype>const <classname>any_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  12. <copy-assignment><type><classname>any_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>any_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  13. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a container an assertion is raised.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  14. </class><class name="any_member_hook"><template>
  15. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  16. </template><inherit access="public">make_any_member_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Store this hook in a class to be inserted in an intrusive container.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
  17. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>container::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  18. </method-group>
  19. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  20. <constructor><parameter name=""><paramtype>const <classname>any_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  21. <copy-assignment><type><classname>any_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>any_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  22. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a container an assertion is raised.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  23. </class><struct name="any_to_avl_set_hook"><template>
  24. <template-type-parameter name="BasicHook"/>
  25. </template><description><para>This option setter specifies that any hook should behave as an <classname alt="boost::intrusive::avl_set">avl_set</classname> hook </para></description></struct><struct name="any_to_bs_set_hook"><template>
  26. <template-type-parameter name="BasicHook"/>
  27. </template><description><para>This option setter specifies that any hook should behave as a <classname alt="boost::intrusive::bs_set">bs_set</classname> hook </para></description></struct><struct name="any_to_list_hook"><template>
  28. <template-type-parameter name="BasicHook"/>
  29. </template><description><para>This option setter specifies that any hook should behave as an list hook </para></description></struct><struct name="any_to_set_hook"><template>
  30. <template-type-parameter name="BasicHook"/>
  31. </template><description><para>This option setter specifies that any hook should behave as a set hook </para></description></struct><struct name="any_to_slist_hook"><template>
  32. <template-type-parameter name="BasicHook"/>
  33. </template><description><para>This option setter specifies that any hook should behave as an slist hook </para></description></struct><struct name="any_to_unordered_set_hook"><template>
  34. <template-type-parameter name="BasicHook"/>
  35. </template><description><para>This option setter specifies that any hook should behave as an unordered set hook </para></description></struct><struct name="make_any_base_hook"><template>
  36. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  37. </template><description><para>Helper metafunction to define a <computeroutput><computeroutput><classname alt="boost::intrusive::any_base_hook">any_base_hook</classname></computeroutput> that</computeroutput> yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  38. </struct><struct name="make_any_member_hook"><template>
  39. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  40. </template><description><para>Helper metafunction to define a <computeroutput><computeroutput><classname alt="boost::intrusive::any_member_hook">any_member_hook</classname></computeroutput> that</computeroutput> yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  41. </struct>
  42. </namespace>
  43. </namespace>
  44. </header>
  45. <header name="boost/intrusive/avl_set.hpp">
  46. <namespace name="boost">
  47. <namespace name="intrusive">
  48. <class name="avl_multiset"><template>
  49. <template-type-parameter name="T"/>
  50. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  51. </template><description><para>The class template <classname alt="boost::intrusive::avl_multiset">avl_multiset</classname> is an intrusive container, that mimics most of the interface of std::_multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  52. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  53. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  54. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  55. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  56. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  57. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  58. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  59. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  60. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  61. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  62. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  63. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  64. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  65. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  66. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  67. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  68. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  69. <typedef name="node"><type>implementation_defined::node</type></typedef>
  70. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  71. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  72. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  73. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  74. <method-group name="public member functions">
  75. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  76. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  77. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  78. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  79. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  80. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  81. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  82. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  83. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  84. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  85. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  86. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  87. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  88. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  89. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  90. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  91. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  92. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  93. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  94. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>avl_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  95. <method name="clone_from"><type>void</type><template>
  96. <template-type-parameter name="Cloner"/>
  97. <template-type-parameter name="Disposer"/>
  98. </template><parameter name="src"><paramtype>const <classname>avl_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  99. <method name="clone_from"><type>void</type><template>
  100. <template-type-parameter name="Cloner"/>
  101. <template-type-parameter name="Disposer"/>
  102. </template><parameter name="src"><paramtype><classname>avl_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  103. <method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  104. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  105. <method name="insert"><type>void</type><template>
  106. <template-type-parameter name="Iterator"/>
  107. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  108. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  109. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  110. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  111. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  112. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  113. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  114. <method name="erase"><type>size_type</type><template>
  115. <template-type-parameter name="KeyType"/>
  116. <template-type-parameter name="KeyTypeKeyCompare"/>
  117. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  118. <method name="erase_and_dispose"><type>iterator</type><template>
  119. <template-type-parameter name="Disposer"/>
  120. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  121. <method name="erase_and_dispose"><type>iterator</type><template>
  122. <template-type-parameter name="Disposer"/>
  123. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  124. <method name="erase_and_dispose"><type>size_type</type><template>
  125. <template-type-parameter name="Disposer"/>
  126. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  127. <method name="erase_and_dispose"><type>size_type</type><template>
  128. <template-type-parameter name="KeyType"/>
  129. <template-type-parameter name="KeyTypeKeyCompare"/>
  130. <template-type-parameter name="Disposer"/>
  131. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  132. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  133. <method name="clear_and_dispose"><type>void</type><template>
  134. <template-type-parameter name="Disposer"/>
  135. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  136. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  137. <method name="count" cv="const"><type>size_type</type><template>
  138. <template-type-parameter name="KeyType"/>
  139. <template-type-parameter name="KeyTypeKeyCompare"/>
  140. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  141. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  142. <method name="lower_bound"><type>iterator</type><template>
  143. <template-type-parameter name="KeyType"/>
  144. <template-type-parameter name="KeyTypeKeyCompare"/>
  145. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  146. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  147. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  148. <template-type-parameter name="KeyType"/>
  149. <template-type-parameter name="KeyTypeKeyCompare"/>
  150. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  151. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  152. <method name="upper_bound"><type>iterator</type><template>
  153. <template-type-parameter name="KeyType"/>
  154. <template-type-parameter name="KeyTypeKeyCompare"/>
  155. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  156. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  157. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  158. <template-type-parameter name="KeyType"/>
  159. <template-type-parameter name="KeyTypeKeyCompare"/>
  160. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  161. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  162. <method name="find"><type>iterator</type><template>
  163. <template-type-parameter name="KeyType"/>
  164. <template-type-parameter name="KeyTypeKeyCompare"/>
  165. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  166. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  167. <method name="find" cv="const"><type>const_iterator</type><template>
  168. <template-type-parameter name="KeyType"/>
  169. <template-type-parameter name="KeyTypeKeyCompare"/>
  170. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  171. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  172. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  173. <template-type-parameter name="KeyType"/>
  174. <template-type-parameter name="KeyTypeKeyCompare"/>
  175. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  176. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  177. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  178. <template-type-parameter name="KeyType"/>
  179. <template-type-parameter name="KeyTypeKeyCompare"/>
  180. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  181. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  182. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  183. <template-type-parameter name="KeyType"/>
  184. <template-type-parameter name="KeyTypeKeyCompare"/>
  185. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  186. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;key</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  187. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  188. <template-type-parameter name="KeyType"/>
  189. <template-type-parameter name="KeyTypeKeyCompare"/>
  190. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  191. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  192. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  193. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  194. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  195. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  196. <method name="merge"><type>void</type><template>
  197. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  198. </template><parameter name="source"><paramtype><classname>avl_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  199. <method name="merge"><type>void</type><template>
  200. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  201. </template><parameter name="source"><paramtype><classname>avl_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  202. </method-group>
  203. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  204. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  205. <constructor><template>
  206. <template-type-parameter name="Iterator"/>
  207. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  208. <constructor><parameter name="x"><paramtype><classname>avl_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  209. <copy-assignment><type><classname>avl_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>avl_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  210. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  211. <method-group name="public static functions">
  212. <method name="container_from_end_iterator" specifiers="static"><type><classname>avl_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  213. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>avl_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  214. <method name="container_from_iterator" specifiers="static"><type><classname>avl_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  215. <method name="container_from_iterator" specifiers="static"><type>const <classname>avl_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  216. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  217. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  218. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  219. </method-group>
  220. </class><class name="avl_set"><template>
  221. <template-type-parameter name="T"/>
  222. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  223. </template><description><para>The class template <classname alt="boost::intrusive::avl_set">avl_set</classname> is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  224. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  225. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  226. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  227. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  228. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  229. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  230. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  231. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  232. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  233. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  234. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  235. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  236. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  237. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  238. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  239. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  240. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  241. <typedef name="node"><type>implementation_defined::node</type></typedef>
  242. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  243. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  244. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  245. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  246. <method-group name="public member functions">
  247. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  248. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  249. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  250. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  251. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  252. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  253. <method name="avlegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  254. <method name="avlegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  255. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  256. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  257. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  258. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  259. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  260. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  261. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  262. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  263. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  264. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  265. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  266. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>avl_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  267. <method name="clone_from"><type>void</type><template>
  268. <template-type-parameter name="Cloner"/>
  269. <template-type-parameter name="Disposer"/>
  270. </template><parameter name="src"><paramtype>const <classname>avl_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  271. <method name="clone_from"><type>void</type><template>
  272. <template-type-parameter name="Cloner"/>
  273. <template-type-parameter name="Disposer"/>
  274. </template><parameter name="src"><paramtype><classname>avl_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  275. <method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  276. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  277. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  278. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  279. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  280. <template-type-parameter name="KeyType"/>
  281. <template-type-parameter name="KeyTypeKeyCompare"/>
  282. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  283. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  284. <template-type-parameter name="KeyType"/>
  285. <template-type-parameter name="KeyTypeKeyCompare"/>
  286. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  287. <method name="insert"><type>void</type><template>
  288. <template-type-parameter name="Iterator"/>
  289. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  290. <method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  291. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  292. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  293. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  294. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  295. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  296. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  297. <method name="erase"><type>size_type</type><template>
  298. <template-type-parameter name="KeyType"/>
  299. <template-type-parameter name="KeyTypeKeyCompare"/>
  300. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  301. <method name="erase_and_dispose"><type>iterator</type><template>
  302. <template-type-parameter name="Disposer"/>
  303. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  304. <method name="erase_and_dispose"><type>iterator</type><template>
  305. <template-type-parameter name="Disposer"/>
  306. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  307. <method name="erase_and_dispose"><type>size_type</type><template>
  308. <template-type-parameter name="Disposer"/>
  309. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  310. <method name="erase_and_dispose"><type>size_type</type><template>
  311. <template-type-parameter name="KeyType"/>
  312. <template-type-parameter name="KeyTypeKeyCompare"/>
  313. <template-type-parameter name="Disposer"/>
  314. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  315. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  316. <method name="clear_and_dispose"><type>void</type><template>
  317. <template-type-parameter name="Disposer"/>
  318. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  319. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  320. <method name="count" cv="const"><type>size_type</type><template>
  321. <template-type-parameter name="KeyType"/>
  322. <template-type-parameter name="KeyTypeKeyCompare"/>
  323. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  324. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  325. <method name="lower_bound"><type>iterator</type><template>
  326. <template-type-parameter name="KeyType"/>
  327. <template-type-parameter name="KeyTypeKeyCompare"/>
  328. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  329. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  330. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  331. <template-type-parameter name="KeyType"/>
  332. <template-type-parameter name="KeyTypeKeyCompare"/>
  333. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  334. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  335. <method name="upper_bound"><type>iterator</type><template>
  336. <template-type-parameter name="KeyType"/>
  337. <template-type-parameter name="KeyTypeKeyCompare"/>
  338. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  339. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  340. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  341. <template-type-parameter name="KeyType"/>
  342. <template-type-parameter name="KeyTypeKeyCompare"/>
  343. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  344. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  345. <method name="find"><type>iterator</type><template>
  346. <template-type-parameter name="KeyType"/>
  347. <template-type-parameter name="KeyTypeKeyCompare"/>
  348. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  349. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  350. <method name="find" cv="const"><type>const_iterator</type><template>
  351. <template-type-parameter name="KeyType"/>
  352. <template-type-parameter name="KeyTypeKeyCompare"/>
  353. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  354. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  355. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  356. <template-type-parameter name="KeyType"/>
  357. <template-type-parameter name="KeyTypeKeyCompare"/>
  358. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  359. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  360. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  361. <template-type-parameter name="KeyType"/>
  362. <template-type-parameter name="KeyTypeKeyCompare"/>
  363. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  364. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  365. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  366. <template-type-parameter name="KeyType"/>
  367. <template-type-parameter name="KeyTypeKeyCompare"/>
  368. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  369. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  370. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  371. <template-type-parameter name="KeyType"/>
  372. <template-type-parameter name="KeyTypeKeyCompare"/>
  373. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  374. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  375. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  376. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  377. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  378. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  379. <method name="merge"><type>void</type><template>
  380. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  381. </template><parameter name="source"><paramtype><classname>avl_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  382. <method name="merge"><type>void</type><template>
  383. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  384. </template><parameter name="source"><paramtype><classname>avl_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  385. </method-group>
  386. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  387. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  388. <constructor><template>
  389. <template-type-parameter name="Iterator"/>
  390. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  391. <constructor><parameter name="x"><paramtype><classname>avl_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  392. <copy-assignment><type><classname>avl_set</classname> &amp;</type><parameter name="x"><paramtype><classname>avl_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  393. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  394. <method-group name="public static functions">
  395. <method name="container_from_end_iterator" specifiers="static"><type><classname>avl_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  396. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>avl_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  397. <method name="container_from_iterator" specifiers="static"><type><classname>avl_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  398. <method name="container_from_iterator" specifiers="static"><type>const <classname>avl_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  399. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  400. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  401. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  402. </method-group>
  403. </class><struct name="make_avl_multiset"><template>
  404. <template-type-parameter name="T"/>
  405. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  406. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::avl_multiset">avl_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  407. </struct><struct name="make_avl_set"><template>
  408. <template-type-parameter name="T"/>
  409. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  410. </template><description><para>Helper metafunction to define a <computeroutput>set</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  411. </struct>
  412. <function name="operator!="><type>bool</type><template>
  413. <template-type-parameter name="T"/>
  414. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  415. </template><parameter name="x"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  416. <function name="operator&gt;"><type>bool</type><template>
  417. <template-type-parameter name="T"/>
  418. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  419. </template><parameter name="x"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  420. <function name="operator&lt;="><type>bool</type><template>
  421. <template-type-parameter name="T"/>
  422. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  423. </template><parameter name="x"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  424. <function name="operator&gt;="><type>bool</type><template>
  425. <template-type-parameter name="T"/>
  426. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  427. </template><parameter name="x"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  428. <function name="swap"><type>void</type><template>
  429. <template-type-parameter name="T"/>
  430. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  431. </template><parameter name="x"><paramtype><classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>avl_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  432. <function name="operator!="><type>bool</type><template>
  433. <template-type-parameter name="T"/>
  434. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  435. </template><parameter name="x"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  436. <function name="operator&gt;"><type>bool</type><template>
  437. <template-type-parameter name="T"/>
  438. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  439. </template><parameter name="x"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  440. <function name="operator&lt;="><type>bool</type><template>
  441. <template-type-parameter name="T"/>
  442. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  443. </template><parameter name="x"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  444. <function name="operator&gt;="><type>bool</type><template>
  445. <template-type-parameter name="T"/>
  446. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  447. </template><parameter name="x"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  448. <function name="swap"><type>void</type><template>
  449. <template-type-parameter name="T"/>
  450. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  451. </template><parameter name="x"><paramtype><classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>avl_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  452. </namespace>
  453. </namespace>
  454. </header>
  455. <header name="boost/intrusive/avl_set_hook.hpp">
  456. <namespace name="boost">
  457. <namespace name="intrusive">
  458. <class name="avl_set_base_hook"><template>
  459. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  460. </template><inherit access="public">make_avl_set_base_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::avl_set_base_hook">avl_set_base_hook</classname> in order to store objects in in an avl_set/avl_multiset. <classname alt="boost::intrusive::avl_set_base_hook">avl_set_base_hook</classname> holds the data necessary to maintain the avl_set/avl_multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for avl_set/avl_multiset.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>optimize_size&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>optimize_size&lt;&gt;</computeroutput> will tell the hook to optimize the hook for size instead of speed. </para></description><method-group name="public member functions">
  461. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>avl_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  462. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  463. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  464. </method-group>
  465. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  466. <constructor><parameter name=""><paramtype>const <classname>avl_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  467. <copy-assignment><type><classname>avl_set_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>avl_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  468. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  469. </class><class name="avl_set_member_hook"><template>
  470. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  471. </template><inherit access="public">make_avl_set_member_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::avl_set_member_hook">avl_set_member_hook</classname> in order to store objects of this class in an avl_set/avl_multiset. <classname alt="boost::intrusive::avl_set_member_hook">avl_set_member_hook</classname> holds the data necessary for maintaining the avl_set/avl_multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for avl_set/avl_multiset.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>optimize_size&lt;&gt;</computeroutput>.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>optimize_size&lt;&gt;</computeroutput> will tell the hook to optimize the hook for size instead of speed. </para></description><method-group name="public member functions">
  472. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>avl_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  473. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  474. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  475. </method-group>
  476. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  477. <constructor><parameter name=""><paramtype>const <classname>avl_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  478. <copy-assignment><type><classname>avl_set_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>avl_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  479. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  480. </class><struct name="make_avl_set_base_hook"><template>
  481. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  482. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::avl_set_base_hook">avl_set_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  483. </struct><struct name="make_avl_set_member_hook"><template>
  484. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  485. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::avl_set_member_hook">avl_set_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  486. </struct>
  487. </namespace>
  488. </namespace>
  489. </header>
  490. <header name="boost/intrusive/avltree.hpp">
  491. <namespace name="boost">
  492. <namespace name="intrusive">
  493. <class name="avltree"><template>
  494. <template-type-parameter name="T"/>
  495. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  496. </template><description><para>The class template avltree is an intrusive AVL tree container, that is used to construct intrusive <classname alt="boost::intrusive::avl_set">avl_set</classname> and <classname alt="boost::intrusive::avl_multiset">avl_multiset</classname> containers. The no-throw guarantee holds only, if the key_compare object doesn't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
  497. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  498. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  499. <typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  500. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  501. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  502. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  503. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  504. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  505. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  506. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  507. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  508. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  509. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  510. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  511. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  512. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  513. <typedef name="node"><type>implementation_defined::node</type></typedef>
  514. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  515. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  516. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  517. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  518. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  519. <method-group name="public member functions">
  520. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  521. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  522. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  523. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  524. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  525. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  526. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  527. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  528. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  529. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  530. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  531. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  532. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  533. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  534. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  535. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  536. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  537. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  538. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  539. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>avltree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  540. <method name="clone_from"><type>void</type><template>
  541. <template-type-parameter name="Cloner"/>
  542. <template-type-parameter name="Disposer"/>
  543. </template><parameter name="src"><paramtype>const <classname>avltree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  544. <method name="clone_from"><type>void</type><template>
  545. <template-type-parameter name="Cloner"/>
  546. <template-type-parameter name="Disposer"/>
  547. </template><parameter name="src"><paramtype><classname>avltree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  548. <method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  549. <method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  550. <method name="insert_equal"><type>void</type><template>
  551. <template-type-parameter name="Iterator"/>
  552. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  553. <method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  554. <method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  555. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  556. <template-type-parameter name="KeyType"/>
  557. <template-type-parameter name="KeyTypeKeyCompare"/>
  558. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  559. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  560. <template-type-parameter name="KeyType"/>
  561. <template-type-parameter name="KeyTypeKeyCompare"/>
  562. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  563. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  564. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  565. <method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  566. <method name="insert_unique"><type>void</type><template>
  567. <template-type-parameter name="Iterator"/>
  568. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  569. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  570. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  571. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  572. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  573. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  574. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  575. <method name="erase"><type>size_type</type><template>
  576. <template-type-parameter name="KeyType"/>
  577. <template-type-parameter name="KeyTypeKeyCompare"/>
  578. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  579. <method name="erase_and_dispose"><type>iterator</type><template>
  580. <template-type-parameter name="Disposer"/>
  581. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  582. <method name="erase_and_dispose"><type>iterator</type><template>
  583. <template-type-parameter name="Disposer"/>
  584. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  585. <method name="erase_and_dispose"><type>size_type</type><template>
  586. <template-type-parameter name="Disposer"/>
  587. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  588. <method name="erase_and_dispose"><type>size_type</type><template>
  589. <template-type-parameter name="KeyType"/>
  590. <template-type-parameter name="KeyTypeKeyCompare"/>
  591. <template-type-parameter name="Disposer"/>
  592. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  593. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  594. <method name="clear_and_dispose"><type>void</type><template>
  595. <template-type-parameter name="Disposer"/>
  596. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  597. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  598. <method name="count" cv="const"><type>size_type</type><template>
  599. <template-type-parameter name="KeyType"/>
  600. <template-type-parameter name="KeyTypeKeyCompare"/>
  601. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  602. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  603. <method name="lower_bound"><type>iterator</type><template>
  604. <template-type-parameter name="KeyType"/>
  605. <template-type-parameter name="KeyTypeKeyCompare"/>
  606. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  607. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  608. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  609. <template-type-parameter name="KeyType"/>
  610. <template-type-parameter name="KeyTypeKeyCompare"/>
  611. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  612. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  613. <method name="upper_bound"><type>iterator</type><template>
  614. <template-type-parameter name="KeyType"/>
  615. <template-type-parameter name="KeyTypeKeyCompare"/>
  616. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  617. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  618. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  619. <template-type-parameter name="KeyType"/>
  620. <template-type-parameter name="KeyTypeKeyCompare"/>
  621. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  622. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  623. <method name="find"><type>iterator</type><template>
  624. <template-type-parameter name="KeyType"/>
  625. <template-type-parameter name="KeyTypeKeyCompare"/>
  626. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  627. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  628. <method name="find" cv="const"><type>const_iterator</type><template>
  629. <template-type-parameter name="KeyType"/>
  630. <template-type-parameter name="KeyTypeKeyCompare"/>
  631. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  632. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  633. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  634. <template-type-parameter name="KeyType"/>
  635. <template-type-parameter name="KeyTypeKeyCompare"/>
  636. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  637. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  638. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  639. <template-type-parameter name="KeyType"/>
  640. <template-type-parameter name="KeyTypeKeyCompare"/>
  641. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  642. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  643. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  644. <template-type-parameter name="KeyType"/>
  645. <template-type-parameter name="KeyTypeKeyCompare"/>
  646. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  647. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  648. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  649. <template-type-parameter name="KeyType"/>
  650. <template-type-parameter name="KeyTypeKeyCompare"/>
  651. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  652. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  653. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  654. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  655. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  656. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  657. <method name="merge_unique"><type>void</type><template>
  658. <template-type-parameter name="T"/>
  659. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  660. </template><parameter name=""><paramtype><classname>avltree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  661. <method name="merge_equal"><type>void</type><template>
  662. <template-type-parameter name="T"/>
  663. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  664. </template><parameter name=""><paramtype><classname>avltree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  665. </method-group>
  666. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  667. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  668. <constructor><template>
  669. <template-type-parameter name="Iterator"/>
  670. </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  671. <constructor><parameter name="x"><paramtype><classname>avltree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  672. <copy-assignment><type><classname>avltree</classname> &amp;</type><parameter name="x"><paramtype><classname>avltree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  673. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  674. <method-group name="public static functions">
  675. <method name="container_from_end_iterator" specifiers="static"><type><classname>avltree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  676. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>avltree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  677. <method name="container_from_iterator" specifiers="static"><type><classname>avltree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  678. <method name="container_from_iterator" specifiers="static"><type>const <classname>avltree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  679. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  680. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  681. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  682. </method-group>
  683. </class><struct name="make_avltree"><template>
  684. <template-type-parameter name="T"/>
  685. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  686. </template><description><para>Helper metafunction to define a <computeroutput>avltree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  687. </struct>
  688. </namespace>
  689. </namespace>
  690. </header>
  691. <header name="boost/intrusive/avltree_algorithms.hpp">
  692. <namespace name="boost">
  693. <namespace name="intrusive">
  694. <class name="avltree_algorithms"><template>
  695. <template-type-parameter name="NodeTraits"/>
  696. </template><description><para><classname alt="boost::intrusive::avltree_algorithms">avltree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><computeroutput>balance</computeroutput>: The type of the balance factor</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput></para><para><computeroutput>static balance get_balance(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_balance(node_ptr n, balance b);</computeroutput></para><para><computeroutput>static balance negative();</computeroutput></para><para><computeroutput>static balance zero();</computeroutput></para><para><computeroutput>static balance positive();</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
  697. <typedef name="node_traits"><type>NodeTraits</type></typedef>
  698. <typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
  699. <typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
  700. <typedef name="balance"><type>NodeTraits::balance</type></typedef>
  701. <typedef name="insert_commit_data"><description><para>This type is the information that will be filled by insert_unique_check </para></description><type>bstree_algo::insert_commit_data</type></typedef>
  702. <method-group name="public static functions">
  703. <method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  704. <method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  705. <method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  706. <method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  707. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  708. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  709. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
  710. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
  711. <method name="unlink" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  712. <method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
  713. <method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  714. <method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  715. <method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  716. <method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  717. <method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  718. <method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  719. <method name="erase" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  720. <method name="transfer_unique" specifiers="static"><type>bool</type><template>
  721. <template-type-parameter name="NodePtrCompare"/>
  722. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  723. <method name="transfer_equal" specifiers="static"><type>void</type><template>
  724. <template-type-parameter name="NodePtrCompare"/>
  725. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  726. <method name="clone" specifiers="static"><type>void</type><template>
  727. <template-type-parameter name="Cloner"/>
  728. <template-type-parameter name="Disposer"/>
  729. </template><parameter name="source_header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  730. <method name="clear_and_dispose" specifiers="static"><type>void</type><template>
  731. <template-type-parameter name="Disposer"/>
  732. </template><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  733. <method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
  734. <template-type-parameter name="KeyType"/>
  735. <template-type-parameter name="KeyNodePtrCompare"/>
  736. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  737. <method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
  738. <template-type-parameter name="KeyType"/>
  739. <template-type-parameter name="KeyNodePtrCompare"/>
  740. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  741. <method name="find" specifiers="static"><type>node_ptr</type><template>
  742. <template-type-parameter name="KeyType"/>
  743. <template-type-parameter name="KeyNodePtrCompare"/>
  744. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  745. <method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  746. <template-type-parameter name="KeyType"/>
  747. <template-type-parameter name="KeyNodePtrCompare"/>
  748. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  749. <method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  750. <template-type-parameter name="KeyType"/>
  751. <template-type-parameter name="KeyNodePtrCompare"/>
  752. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
  753. <method name="count" specifiers="static"><type>std::size_t</type><template>
  754. <template-type-parameter name="KeyType"/>
  755. <template-type-parameter name="KeyNodePtrCompare"/>
  756. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  757. <method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
  758. <template-type-parameter name="NodePtrCompare"/>
  759. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  760. <method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
  761. <template-type-parameter name="NodePtrCompare"/>
  762. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  763. <method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
  764. <template-type-parameter name="NodePtrCompare"/>
  765. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  766. <method name="insert_before" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
  767. <method name="push_back" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  768. <method name="push_front" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  769. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  770. <template-type-parameter name="KeyType"/>
  771. <template-type-parameter name="KeyNodePtrCompare"/>
  772. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  773. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  774. <template-type-parameter name="KeyType"/>
  775. <template-type-parameter name="KeyNodePtrCompare"/>
  776. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="hint"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  777. <method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  778. <method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  779. </method-group>
  780. </class>
  781. </namespace>
  782. </namespace>
  783. </header>
  784. <header name="boost/intrusive/bs_set.hpp">
  785. <namespace name="boost">
  786. <namespace name="intrusive">
  787. <class name="bs_multiset"><template>
  788. <template-type-parameter name="T"/>
  789. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  790. </template><description><para>The class template <classname alt="boost::intrusive::bs_multiset">bs_multiset</classname> is an intrusive container, that mimics most of the interface of std::multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  791. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  792. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  793. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  794. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  795. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  796. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  797. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  798. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  799. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  800. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  801. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  802. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  803. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  804. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  805. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  806. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  807. <typedef name="node"><type>implementation_defined::node</type></typedef>
  808. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  809. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  810. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  811. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  812. <method-group name="public member functions">
  813. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  814. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  815. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  816. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  817. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  818. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  819. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  820. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  821. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  822. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  823. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  824. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  825. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  826. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  827. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  828. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  829. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  830. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  831. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  832. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>bs_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  833. <method name="clone_from"><type>void</type><template>
  834. <template-type-parameter name="Cloner"/>
  835. <template-type-parameter name="Disposer"/>
  836. </template><parameter name="src"><paramtype>const <classname>bs_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  837. <method name="clone_from"><type>void</type><template>
  838. <template-type-parameter name="Cloner"/>
  839. <template-type-parameter name="Disposer"/>
  840. </template><parameter name="src"><paramtype><classname>bs_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  841. <method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  842. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  843. <method name="insert"><type>void</type><template>
  844. <template-type-parameter name="Iterator"/>
  845. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  846. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  847. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  848. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  849. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  850. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  851. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  852. <method name="erase"><type>size_type</type><template>
  853. <template-type-parameter name="KeyType"/>
  854. <template-type-parameter name="KeyTypeKeyCompare"/>
  855. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  856. <method name="erase_and_dispose"><type>iterator</type><template>
  857. <template-type-parameter name="Disposer"/>
  858. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  859. <method name="erase_and_dispose"><type>iterator</type><template>
  860. <template-type-parameter name="Disposer"/>
  861. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  862. <method name="erase_and_dispose"><type>size_type</type><template>
  863. <template-type-parameter name="Disposer"/>
  864. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  865. <method name="erase_and_dispose"><type>size_type</type><template>
  866. <template-type-parameter name="KeyType"/>
  867. <template-type-parameter name="KeyTypeKeyCompare"/>
  868. <template-type-parameter name="Disposer"/>
  869. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  870. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  871. <method name="clear_and_dispose"><type>void</type><template>
  872. <template-type-parameter name="Disposer"/>
  873. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  874. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  875. <method name="count" cv="const"><type>size_type</type><template>
  876. <template-type-parameter name="KeyType"/>
  877. <template-type-parameter name="KeyTypeKeyCompare"/>
  878. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  879. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  880. <method name="lower_bound"><type>iterator</type><template>
  881. <template-type-parameter name="KeyType"/>
  882. <template-type-parameter name="KeyTypeKeyCompare"/>
  883. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  884. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  885. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  886. <template-type-parameter name="KeyType"/>
  887. <template-type-parameter name="KeyTypeKeyCompare"/>
  888. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  889. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  890. <method name="upper_bound"><type>iterator</type><template>
  891. <template-type-parameter name="KeyType"/>
  892. <template-type-parameter name="KeyTypeKeyCompare"/>
  893. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  894. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  895. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  896. <template-type-parameter name="KeyType"/>
  897. <template-type-parameter name="KeyTypeKeyCompare"/>
  898. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  899. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  900. <method name="find"><type>iterator</type><template>
  901. <template-type-parameter name="KeyType"/>
  902. <template-type-parameter name="KeyTypeKeyCompare"/>
  903. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  904. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  905. <method name="find" cv="const"><type>const_iterator</type><template>
  906. <template-type-parameter name="KeyType"/>
  907. <template-type-parameter name="KeyTypeKeyCompare"/>
  908. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  909. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  910. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  911. <template-type-parameter name="KeyType"/>
  912. <template-type-parameter name="KeyTypeKeyCompare"/>
  913. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  914. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  915. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  916. <template-type-parameter name="KeyType"/>
  917. <template-type-parameter name="KeyTypeKeyCompare"/>
  918. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  919. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  920. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  921. <template-type-parameter name="KeyType"/>
  922. <template-type-parameter name="KeyTypeKeyCompare"/>
  923. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  924. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  925. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  926. <template-type-parameter name="KeyType"/>
  927. <template-type-parameter name="KeyTypeKeyCompare"/>
  928. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  929. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  930. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  931. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  932. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  933. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  934. <method name="merge"><type>void</type><template>
  935. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  936. </template><parameter name="source"><paramtype><classname>bs_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  937. <method name="merge"><type>void</type><template>
  938. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  939. </template><parameter name="source"><paramtype><classname>bs_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  940. </method-group>
  941. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  942. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  943. <constructor><template>
  944. <template-type-parameter name="Iterator"/>
  945. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  946. <constructor><parameter name="x"><paramtype><classname>bs_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  947. <copy-assignment><type><classname>bs_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>bs_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  948. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  949. <method-group name="public static functions">
  950. <method name="container_from_end_iterator" specifiers="static"><type><classname>bs_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  951. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>bs_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  952. <method name="container_from_iterator" specifiers="static"><type><classname>bs_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  953. <method name="container_from_iterator" specifiers="static"><type>const <classname>bs_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  954. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  955. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  956. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  957. </method-group>
  958. </class><class name="bs_set"><template>
  959. <template-type-parameter name="T"/>
  960. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  961. </template><description><para>The class template <classname alt="boost::intrusive::bs_set">bs_set</classname> is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  962. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  963. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  964. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  965. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  966. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  967. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  968. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  969. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  970. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  971. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  972. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  973. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  974. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  975. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  976. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  977. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  978. <typedef name="node"><type>implementation_defined::node</type></typedef>
  979. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  980. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  981. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  982. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  983. <method-group name="public member functions">
  984. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  985. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  986. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  987. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  988. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  989. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  990. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  991. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  992. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  993. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  994. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  995. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  996. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  997. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  998. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  999. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  1000. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  1001. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1002. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1003. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>bs_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  1004. <method name="clone_from"><type>void</type><template>
  1005. <template-type-parameter name="Cloner"/>
  1006. <template-type-parameter name="Disposer"/>
  1007. </template><parameter name="src"><paramtype>const <classname>bs_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  1008. <method name="clone_from"><type>void</type><template>
  1009. <template-type-parameter name="Cloner"/>
  1010. <template-type-parameter name="Disposer"/>
  1011. </template><parameter name="src"><paramtype><classname>bs_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  1012. <method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1013. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1014. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  1015. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  1016. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  1017. <template-type-parameter name="KeyType"/>
  1018. <template-type-parameter name="KeyTypeKeyCompare"/>
  1019. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  1020. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  1021. <template-type-parameter name="KeyType"/>
  1022. <template-type-parameter name="KeyTypeKeyCompare"/>
  1023. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  1024. <method name="insert"><type>void</type><template>
  1025. <template-type-parameter name="Iterator"/>
  1026. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1027. <method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  1028. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  1029. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  1030. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  1031. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1032. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1033. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1034. <method name="erase"><type>size_type</type><template>
  1035. <template-type-parameter name="KeyType"/>
  1036. <template-type-parameter name="KeyTypeKeyCompare"/>
  1037. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1038. <method name="erase_and_dispose"><type>iterator</type><template>
  1039. <template-type-parameter name="Disposer"/>
  1040. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  1041. <method name="erase_and_dispose"><type>iterator</type><template>
  1042. <template-type-parameter name="Disposer"/>
  1043. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  1044. <method name="erase_and_dispose"><type>size_type</type><template>
  1045. <template-type-parameter name="Disposer"/>
  1046. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1047. <method name="erase_and_dispose"><type>size_type</type><template>
  1048. <template-type-parameter name="KeyType"/>
  1049. <template-type-parameter name="KeyTypeKeyCompare"/>
  1050. <template-type-parameter name="Disposer"/>
  1051. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  1052. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1053. <method name="clear_and_dispose"><type>void</type><template>
  1054. <template-type-parameter name="Disposer"/>
  1055. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  1056. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1057. <method name="count" cv="const"><type>size_type</type><template>
  1058. <template-type-parameter name="KeyType"/>
  1059. <template-type-parameter name="KeyTypeKeyCompare"/>
  1060. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1061. <method name="lower_bound"><type>iterator</type><parameter name=""><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1062. <method name="lower_bound"><type>iterator</type><template>
  1063. <template-type-parameter name="KeyType"/>
  1064. <template-type-parameter name="KeyTypeKeyCompare"/>
  1065. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1066. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1067. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  1068. <template-type-parameter name="KeyType"/>
  1069. <template-type-parameter name="KeyTypeKeyCompare"/>
  1070. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1071. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1072. <method name="upper_bound"><type>iterator</type><template>
  1073. <template-type-parameter name="KeyType"/>
  1074. <template-type-parameter name="KeyTypeKeyCompare"/>
  1075. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1076. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1077. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  1078. <template-type-parameter name="KeyType"/>
  1079. <template-type-parameter name="KeyTypeKeyCompare"/>
  1080. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1081. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1082. <method name="find"><type>iterator</type><template>
  1083. <template-type-parameter name="KeyType"/>
  1084. <template-type-parameter name="KeyTypeKeyCompare"/>
  1085. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1086. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1087. <method name="find" cv="const"><type>const_iterator</type><template>
  1088. <template-type-parameter name="KeyType"/>
  1089. <template-type-parameter name="KeyTypeKeyCompare"/>
  1090. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1091. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1092. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  1093. <template-type-parameter name="KeyType"/>
  1094. <template-type-parameter name="KeyTypeKeyCompare"/>
  1095. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1096. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1097. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  1098. <template-type-parameter name="KeyType"/>
  1099. <template-type-parameter name="KeyTypeKeyCompare"/>
  1100. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1101. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  1102. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  1103. <template-type-parameter name="KeyType"/>
  1104. <template-type-parameter name="KeyTypeKeyCompare"/>
  1105. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  1106. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  1107. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  1108. <template-type-parameter name="KeyType"/>
  1109. <template-type-parameter name="KeyTypeKeyCompare"/>
  1110. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  1111. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1112. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1113. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  1114. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  1115. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  1116. <method name="merge"><type>void</type><template>
  1117. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  1118. </template><parameter name="source"><paramtype><classname>bs_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  1119. <method name="merge"><type>void</type><template>
  1120. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  1121. </template><parameter name="source"><paramtype><classname>bs_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  1122. </method-group>
  1123. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  1124. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  1125. <constructor><template>
  1126. <template-type-parameter name="Iterator"/>
  1127. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  1128. <constructor><parameter name="x"><paramtype><classname>bs_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  1129. <copy-assignment><type><classname>bs_set</classname> &amp;</type><parameter name="x"><paramtype><classname>bs_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  1130. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  1131. <method-group name="public static functions">
  1132. <method name="container_from_end_iterator" specifiers="static"><type><classname>bs_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  1133. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>bs_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  1134. <method name="container_from_iterator" specifiers="static"><type><classname>bs_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  1135. <method name="container_from_iterator" specifiers="static"><type>const <classname>bs_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  1136. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  1137. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  1138. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  1139. </method-group>
  1140. </class><struct name="make_bs_multiset"><template>
  1141. <template-type-parameter name="T"/>
  1142. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1143. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::bs_multiset">bs_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  1144. </struct><struct name="make_bs_set"><template>
  1145. <template-type-parameter name="T"/>
  1146. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1147. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::bs_set">bs_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  1148. </struct>
  1149. <function name="operator!="><type>bool</type><template>
  1150. <template-type-parameter name="T"/>
  1151. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1152. </template><parameter name="x"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1153. <function name="operator&gt;"><type>bool</type><template>
  1154. <template-type-parameter name="T"/>
  1155. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1156. </template><parameter name="x"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1157. <function name="operator&lt;="><type>bool</type><template>
  1158. <template-type-parameter name="T"/>
  1159. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1160. </template><parameter name="x"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1161. <function name="operator&gt;="><type>bool</type><template>
  1162. <template-type-parameter name="T"/>
  1163. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1164. </template><parameter name="x"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1165. <function name="swap"><type>void</type><template>
  1166. <template-type-parameter name="T"/>
  1167. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1168. </template><parameter name="x"><paramtype><classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>bs_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1169. <function name="operator!="><type>bool</type><template>
  1170. <template-type-parameter name="T"/>
  1171. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1172. </template><parameter name="x"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1173. <function name="operator&gt;"><type>bool</type><template>
  1174. <template-type-parameter name="T"/>
  1175. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1176. </template><parameter name="x"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1177. <function name="operator&lt;="><type>bool</type><template>
  1178. <template-type-parameter name="T"/>
  1179. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1180. </template><parameter name="x"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1181. <function name="operator&gt;="><type>bool</type><template>
  1182. <template-type-parameter name="T"/>
  1183. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1184. </template><parameter name="x"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1185. <function name="swap"><type>void</type><template>
  1186. <template-type-parameter name="T"/>
  1187. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1188. </template><parameter name="x"><paramtype><classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>bs_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  1189. </namespace>
  1190. </namespace>
  1191. </header>
  1192. <header name="boost/intrusive/bs_set_hook.hpp">
  1193. <namespace name="boost">
  1194. <namespace name="intrusive">
  1195. <class name="bs_set_base_hook"><template>
  1196. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1197. </template><inherit access="public">make_bs_set_base_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::bs_set_base_hook">bs_set_base_hook</classname> in order to store objects in in a bs_set/bs_multiset. <classname alt="boost::intrusive::bs_set_base_hook">bs_set_base_hook</classname> holds the data necessary to maintain the bs_set/bs_multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for bs_set/bs_multiset.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>). </para></description><method-group name="public member functions">
  1198. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>bs_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1199. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  1200. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1201. </method-group>
  1202. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  1203. <constructor><parameter name=""><paramtype>const <classname>bs_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  1204. <copy-assignment><type><classname>bs_set_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>bs_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  1205. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  1206. </class><class name="bs_set_member_hook"><template>
  1207. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1208. </template><inherit access="public">make_bs_set_member_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::bs_set_member_hook">bs_set_member_hook</classname> in order to store objects of this class in a bs_set/bs_multiset. <classname alt="boost::intrusive::bs_set_member_hook">bs_set_member_hook</classname> holds the data necessary for maintaining the bs_set/bs_multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for bs_set/bs_multiset.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>). </para></description><method-group name="public member functions">
  1209. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>bs_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1210. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  1211. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1212. </method-group>
  1213. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  1214. <constructor><parameter name=""><paramtype>const <classname>bs_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  1215. <copy-assignment><type><classname>bs_set_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>bs_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  1216. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  1217. </class><struct name="make_bs_set_base_hook"><template>
  1218. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1219. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::bs_set_base_hook">bs_set_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  1220. </struct><struct name="make_bs_set_member_hook"><template>
  1221. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1222. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::bs_set_member_hook">bs_set_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  1223. </struct>
  1224. </namespace>
  1225. </namespace>
  1226. </header>
  1227. <header name="boost/intrusive/bstree.hpp">
  1228. <namespace name="boost">
  1229. <namespace name="intrusive">
  1230. <class name="bstree"><template>
  1231. <template-type-parameter name="T"/>
  1232. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1233. </template><inherit access="public">bstbase&lt; ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, ConstantTimeSize, SizeType, AlgoType, HeaderHolder &gt;</inherit><description><para>The class template bstree is an unbalanced intrusive binary search tree container. The no-throw guarantee holds only, if the key_compare object doesn't throw.</para><para>The complexity guarantees only hold if the tree is balanced, logarithmic complexity would increase to linear if the tree is totally unbalanced.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>implementation_defined</type></typedef>
  1234. <typedef name="pointer"><type>implementation_defined</type></typedef>
  1235. <typedef name="const_pointer"><type>implementation_defined</type></typedef>
  1236. <typedef name="value_type"><type>implementation_defined</type></typedef>
  1237. <typedef name="key_type"><type>implementation_defined</type></typedef>
  1238. <typedef name="key_of_value"><type>implementation_defined</type></typedef>
  1239. <typedef name="reference"><type>implementation_defined</type></typedef>
  1240. <typedef name="const_reference"><type>implementation_defined</type></typedef>
  1241. <typedef name="difference_type"><type>implementation_defined</type></typedef>
  1242. <typedef name="size_type"><type>implementation_defined</type></typedef>
  1243. <typedef name="value_compare"><type>implementation_defined</type></typedef>
  1244. <typedef name="key_compare"><type>implementation_defined</type></typedef>
  1245. <typedef name="iterator"><type>implementation_defined</type></typedef>
  1246. <typedef name="const_iterator"><type>implementation_defined</type></typedef>
  1247. <typedef name="reverse_iterator"><type>implementation_defined</type></typedef>
  1248. <typedef name="const_reverse_iterator"><type>implementation_defined</type></typedef>
  1249. <typedef name="node_traits"><type>implementation_defined</type></typedef>
  1250. <typedef name="node"><type>implementation_defined</type></typedef>
  1251. <typedef name="node_ptr"><type>implementation_defined</type></typedef>
  1252. <typedef name="const_node_ptr"><type>implementation_defined</type></typedef>
  1253. <typedef name="node_algorithms"><type>implementation_defined</type></typedef>
  1254. <typedef name="insert_commit_data"><type>node_algorithms::insert_commit_data</type></typedef>
  1255. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  1256. <data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
  1257. <method-group name="public member functions">
  1258. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1259. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1260. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1261. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1262. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1263. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1264. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1265. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1266. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1267. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1268. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1269. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1270. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1271. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1272. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1273. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  1274. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  1275. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1276. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1277. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>bstree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  1278. <method name="clone_from"><type>void</type><template>
  1279. <template-type-parameter name="Cloner"/>
  1280. <template-type-parameter name="Disposer"/>
  1281. </template><parameter name="src"><paramtype>const <classname>bstree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  1282. <method name="clone_from"><type>void</type><template>
  1283. <template-type-parameter name="Cloner"/>
  1284. <template-type-parameter name="Disposer"/>
  1285. </template><parameter name="src"><paramtype><classname>bstree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  1286. <method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1287. <method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1288. <method name="insert_equal"><type>void</type><template>
  1289. <template-type-parameter name="Iterator"/>
  1290. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1291. <method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1292. <method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1293. <method name="insert_unique"><type>void</type><template>
  1294. <template-type-parameter name="Iterator"/>
  1295. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1296. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  1297. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  1298. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  1299. <template-type-parameter name="KeyType"/>
  1300. <template-type-parameter name="KeyTypeKeyCompare"/>
  1301. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  1302. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  1303. <template-type-parameter name="KeyType"/>
  1304. <template-type-parameter name="KeyTypeKeyCompare"/>
  1305. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  1306. <method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  1307. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  1308. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  1309. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  1310. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1311. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1312. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1313. <method name="erase"><type>size_type</type><template>
  1314. <template-type-parameter name="KeyType"/>
  1315. <template-type-parameter name="KeyTypeKeyCompare"/>
  1316. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1317. <method name="erase_and_dispose"><type>iterator</type><template>
  1318. <template-type-parameter name="Disposer"/>
  1319. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  1320. <method name="erase_and_dispose"><type>size_type</type><template>
  1321. <template-type-parameter name="Disposer"/>
  1322. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1323. <method name="erase_and_dispose"><type>iterator</type><template>
  1324. <template-type-parameter name="Disposer"/>
  1325. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  1326. <method name="erase_and_dispose"><type>size_type</type><template>
  1327. <template-type-parameter name="KeyType"/>
  1328. <template-type-parameter name="KeyTypeKeyCompare"/>
  1329. <template-type-parameter name="Disposer"/>
  1330. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  1331. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1332. <method name="clear_and_dispose"><type>void</type><template>
  1333. <template-type-parameter name="Disposer"/>
  1334. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  1335. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1336. <method name="count" cv="const"><type>size_type</type><template>
  1337. <template-type-parameter name="KeyType"/>
  1338. <template-type-parameter name="KeyTypeKeyCompare"/>
  1339. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1340. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1341. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1342. <method name="lower_bound"><type>iterator</type><template>
  1343. <template-type-parameter name="KeyType"/>
  1344. <template-type-parameter name="KeyTypeKeyCompare"/>
  1345. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1346. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  1347. <template-type-parameter name="KeyType"/>
  1348. <template-type-parameter name="KeyTypeKeyCompare"/>
  1349. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1350. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1351. <method name="upper_bound"><type>iterator</type><template>
  1352. <template-type-parameter name="KeyType"/>
  1353. <template-type-parameter name="KeyTypeKeyCompare"/>
  1354. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1355. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1356. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  1357. <template-type-parameter name="KeyType"/>
  1358. <template-type-parameter name="KeyTypeKeyCompare"/>
  1359. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1360. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1361. <method name="find"><type>iterator</type><template>
  1362. <template-type-parameter name="KeyType"/>
  1363. <template-type-parameter name="KeyTypeKeyCompare"/>
  1364. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1365. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1366. <method name="find" cv="const"><type>const_iterator</type><template>
  1367. <template-type-parameter name="KeyType"/>
  1368. <template-type-parameter name="KeyTypeKeyCompare"/>
  1369. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1370. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1371. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  1372. <template-type-parameter name="KeyType"/>
  1373. <template-type-parameter name="KeyTypeKeyCompare"/>
  1374. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1375. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  1376. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  1377. <template-type-parameter name="KeyType"/>
  1378. <template-type-parameter name="KeyTypeKeyCompare"/>
  1379. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  1380. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_value"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  1381. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  1382. <template-type-parameter name="KeyType"/>
  1383. <template-type-parameter name="KeyTypeKeyCompare"/>
  1384. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  1385. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  1386. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  1387. <template-type-parameter name="KeyType"/>
  1388. <template-type-parameter name="KeyTypeKeyCompare"/>
  1389. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  1390. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1391. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1392. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  1393. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  1394. <method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  1395. <method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  1396. <method name="merge_unique"><type>void</type><template>
  1397. <template-type-parameter name="T"/>
  1398. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  1399. </template><parameter name=""><paramtype><classname>bstree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  1400. <method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
  1401. <method name="merge_equal"><type>void</type><template>
  1402. <template-type-parameter name="T"/>
  1403. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  1404. </template><parameter name=""><paramtype><classname>bstree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  1405. <method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
  1406. <method name="check" cv="const"><type>void</type><template>
  1407. <template-type-parameter name="ExtraChecker"/>
  1408. </template><parameter name="extra_checker"><paramtype>ExtraChecker</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container with additional checks provided by the user.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
  1409. <method name="check" cv="const"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
  1410. </method-group>
  1411. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  1412. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  1413. <constructor><template>
  1414. <template-type-parameter name="Iterator"/>
  1415. </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  1416. <constructor><parameter name="x"><paramtype><classname>bstree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  1417. <copy-assignment><type><classname>bstree</classname> &amp;</type><parameter name="x"><paramtype><classname>bstree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  1418. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  1419. <method-group name="public static functions">
  1420. <method name="container_from_end_iterator" specifiers="static"><type><classname>bstree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  1421. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>bstree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end const_iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  1422. <method name="container_from_iterator" specifiers="static"><type><classname>bstree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  1423. <method name="container_from_iterator" specifiers="static"><type>const <classname>bstree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid end const_iterator of container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  1424. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  1425. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  1426. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  1427. <method name="remove_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  1428. </method-group>
  1429. </class><struct name="make_bstree"><template>
  1430. <template-type-parameter name="T"/>
  1431. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1432. </template><description><para>Helper metafunction to define a <computeroutput>bstree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  1433. </struct>
  1434. </namespace>
  1435. </namespace>
  1436. </header>
  1437. <header name="boost/intrusive/bstree_algorithms.hpp">
  1438. <namespace name="boost">
  1439. <namespace name="intrusive">
  1440. <class name="bstree_algorithms"><template>
  1441. <template-type-parameter name="NodeTraits"/>
  1442. </template><inherit access="public">bstree_algorithms_base&lt; NodeTraits &gt;</inherit><description><para>This is an implementation of a binary search tree. A node in the search tree has references to its children and its parent. This is to allow traversal of the whole tree from a given node making the implementation of iterator a pointer to a node. At the top of the tree a node is used specially. This node's parent pointer is pointing to the root of the tree. Its left pointer points to the leftmost node in the tree and the right pointer to the rightmost one. This node is used to represent the end-iterator. +---------+
  1443. header------------------------------&gt;| |
  1444. | |
  1445. +----------(left)--------| |--------(right)---------+
  1446. | +---------+ |
  1447. | | |
  1448. | | (parent) |
  1449. | | |
  1450. | | |
  1451. | +---------+ |
  1452. root of tree ..|......................&gt; | | | | | D | | | | | | | +----<mdash/>+------<mdash/>+----<mdash/>+ | <informaltable><tgroup cols="3"><tbody><row>
  1453. <entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry></row>
  1454. <row>
  1455. <entry/><entry/><entry/></row>
  1456. <row>
  1457. <entry/><entry/><entry/></row>
  1458. <row>
  1459. <entry/><entry/><entry/></row>
  1460. </tbody></tgroup></informaltable>
  1461. | +------<mdash/>+ +------<mdash/>+ | | | | | | | | | B | | F | | | | | | | | | +–+------<mdash/>+–+ +–+------<mdash/>+–+ | <informaltable><tgroup cols="5"><tbody><row>
  1462. <entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry><entry><emphasis role="bold"/></entry></row>
  1463. <row>
  1464. <entry/><entry/><entry/><entry/><entry/></row>
  1465. </tbody></tgroup></informaltable>
  1466. | +<mdash/>+--<mdash/>+ +--<mdash/>+<mdash/>+ +<mdash/>+--<mdash/>+ +--<mdash/>+<mdash/>+ | +--&gt;| | | | | | | |&lt;–+ | A | | C | | E | | G | | | | | | | | | +------<mdash/>+ +------<mdash/>+ +------<mdash/>+ +------<mdash/>+</para><para><classname alt="boost::intrusive::bstree_algorithms">bstree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
  1467. <typedef name="node_traits"><type>NodeTraits</type></typedef>
  1468. <typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
  1469. <typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
  1470. <typedef name="insert_commit_data"><type>insert_commit_data_t&lt; node_ptr &gt;</type></typedef>
  1471. <typedef name="data_for_rebalance"><type>data_for_rebalance_t&lt; node_ptr &gt;</type></typedef>
  1472. <method-group name="public static functions">
  1473. <method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1474. <method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1475. <method name="root_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the root of the tree if any, header otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1476. <method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1477. <method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1478. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  1479. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  1480. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
  1481. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
  1482. <method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1483. <method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1484. <method name="minimum" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of a tree but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the minimum node of the subtree starting at p.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the size of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1485. <method name="maximum" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of a tree but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the maximum node of the subtree starting at p.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the size of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1486. <method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  1487. <method name="inited" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns true if node is in the same state as if called init(node)</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1488. <method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  1489. <method name="clear_and_dispose" specifiers="static"><type>void</type><template>
  1490. <template-type-parameter name="Disposer"/>
  1491. </template><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  1492. <method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
  1493. <method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1494. <method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1495. <method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1496. <method name="find" specifiers="static"><type>node_ptr</type><template>
  1497. <template-type-parameter name="KeyType"/>
  1498. <template-type-parameter name="KeyNodePtrCompare"/>
  1499. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  1500. <method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  1501. <template-type-parameter name="KeyType"/>
  1502. <template-type-parameter name="KeyNodePtrCompare"/>
  1503. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
  1504. <method name="count" specifiers="static"><type>std::size_t</type><template>
  1505. <template-type-parameter name="KeyType"/>
  1506. <template-type-parameter name="KeyNodePtrCompare"/>
  1507. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  1508. <method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  1509. <template-type-parameter name="KeyType"/>
  1510. <template-type-parameter name="KeyNodePtrCompare"/>
  1511. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  1512. <method name="lower_bound_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  1513. <template-type-parameter name="KeyType"/>
  1514. <template-type-parameter name="KeyNodePtrCompare"/>
  1515. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing the first element that is equivalent to "key" according to "comp" or an empty range that indicates the position where that element would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  1516. <method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
  1517. <template-type-parameter name="KeyType"/>
  1518. <template-type-parameter name="KeyNodePtrCompare"/>
  1519. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  1520. <method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
  1521. <template-type-parameter name="KeyType"/>
  1522. <template-type-parameter name="KeyNodePtrCompare"/>
  1523. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  1524. <method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  1525. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  1526. <template-type-parameter name="KeyType"/>
  1527. <template-type-parameter name="KeyNodePtrCompare"/>
  1528. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  1529. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  1530. <template-type-parameter name="KeyType"/>
  1531. <template-type-parameter name="KeyNodePtrCompare"/>
  1532. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="hint"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  1533. <method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
  1534. <template-type-parameter name="NodePtrCompare"/>
  1535. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  1536. <method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
  1537. <template-type-parameter name="NodePtrCompare"/>
  1538. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  1539. <method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
  1540. <template-type-parameter name="NodePtrCompare"/>
  1541. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  1542. <method name="insert_before" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
  1543. <method name="push_back" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  1544. <method name="push_front" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  1545. <method name="depth" specifiers="static"><type>std::size_t</type><parameter name="node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' can't be a header node.</para><para><emphasis role="bold">Effects</emphasis>: Calculates the depth of a node: the depth of a node is the length (number of edges) of the path from the root to that node. (The root node is at depth 0.)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of nodes in the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1546. <method name="clone" specifiers="static"><type>void</type><template>
  1547. <template-type-parameter name="Cloner"/>
  1548. <template-type-parameter name="Disposer"/>
  1549. </template><parameter name="source_header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  1550. <method name="erase" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1551. <method name="transfer_unique" specifiers="static"><type>bool</type><template>
  1552. <template-type-parameter name="NodePtrCompare"/>
  1553. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  1554. <method name="transfer_equal" specifiers="static"><type>void</type><template>
  1555. <template-type-parameter name="NodePtrCompare"/>
  1556. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  1557. <method name="unlink" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1558. <method name="rebalance" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  1559. <method name="rebalance_subtree" specifiers="static"><type>node_ptr</type><parameter name="old_root"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree. It shall not be null.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  1560. <method name="check" specifiers="static"><type>void</type><template>
  1561. <template-type-parameter name="Checker"/>
  1562. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="checker"><paramtype>Checker</paramtype></parameter><parameter name="checker_return"><paramtype>typename Checker::return_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container with additional checks provided by the user.</para><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
  1563. </method-group>
  1564. <method-group name="protected static functions">
  1565. <method name="transfer_unique" specifiers="static"><type>bool</type><template>
  1566. <template-type-parameter name="NodePtrCompare"/>
  1567. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="info"><paramtype>data_for_rebalance &amp;</paramtype></parameter></method>
  1568. <method name="transfer_equal" specifiers="static"><type>void</type><template>
  1569. <template-type-parameter name="NodePtrCompare"/>
  1570. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="info"><paramtype>data_for_rebalance &amp;</paramtype></parameter></method>
  1571. <method name="erase" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="info"><paramtype>data_for_rebalance &amp;</paramtype></parameter></method>
  1572. <method name="subtree_size" specifiers="static"><type>std::size_t</type><parameter name="subtree"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1573. <method name="is_left_child" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is a left child.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1574. <method name="is_right_child" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is a right child.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1575. <method name="insert_before_check" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
  1576. <method name="push_back_check" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
  1577. <method name="push_front_check" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
  1578. <method name="insert_equal_check" specifiers="static"><type>void</type><template>
  1579. <template-type-parameter name="NodePtrCompare"/>
  1580. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
  1581. <method name="insert_equal_upper_bound_check" specifiers="static"><type>void</type><template>
  1582. <template-type-parameter name="NodePtrCompare"/>
  1583. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><parameter name="pdepth"><paramtype>std::size_t *</paramtype><default>0</default></parameter></method>
  1584. <method name="insert_equal_lower_bound_check" specifiers="static"><type>void</type><template>
  1585. <template-type-parameter name="NodePtrCompare"/>
  1586. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><parameter name="pdepth"><paramtype>std::size_t *</paramtype><default>0</default></parameter></method>
  1587. <method name="insert_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter></method>
  1588. <method name="set_child" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_child"><paramtype>node_ptr</paramtype></parameter><parameter name="new_parent"><paramtype>node_ptr</paramtype></parameter><parameter name="link_left"><paramtype>const bool</paramtype></parameter></method>
  1589. <method name="rotate_left_no_parent_fix" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="p_right"><paramtype>node_ptr</paramtype></parameter></method>
  1590. <method name="rotate_left" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="p_right"><paramtype>node_ptr</paramtype></parameter><parameter name="p_parent"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter></method>
  1591. <method name="rotate_right_no_parent_fix" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="p_left"><paramtype>node_ptr</paramtype></parameter></method>
  1592. <method name="rotate_right" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="p_left"><paramtype>node_ptr</paramtype></parameter><parameter name="p_parent"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter></method>
  1593. </method-group>
  1594. <method-group name="private static functions">
  1595. <method name="subtree_to_vine" specifiers="static"><type>void</type><parameter name="vine_tail"><paramtype>node_ptr</paramtype></parameter><parameter name="size"><paramtype>std::size_t &amp;</paramtype></parameter></method>
  1596. <method name="compress_subtree" specifiers="static"><type>void</type><parameter name="scanner"><paramtype>node_ptr</paramtype></parameter><parameter name="count"><paramtype>std::size_t</paramtype></parameter></method>
  1597. <method name="vine_to_subtree" specifiers="static"><type>void</type><parameter name="super_root"><paramtype>node_ptr</paramtype></parameter><parameter name="count"><paramtype>std::size_t</paramtype></parameter></method>
  1598. <method name="get_root" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "n" must be a node inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns a pointer to the header node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1599. <method name="clone_subtree" specifiers="static"><type>node_ptr</type><template>
  1600. <template-type-parameter name="Cloner"/>
  1601. <template-type-parameter name="Disposer"/>
  1602. </template><parameter name="source_parent"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="target_parent"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><parameter name="leftmost_out"><paramtype>node_ptr &amp;</paramtype></parameter><parameter name="rightmost_out"><paramtype>node_ptr &amp;</paramtype></parameter></method>
  1603. <method name="dispose_subtree" specifiers="static"><type>void</type><template>
  1604. <template-type-parameter name="Disposer"/>
  1605. </template><parameter name="x"><paramtype>node_ptr</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter></method>
  1606. <method name="lower_bound_loop" specifiers="static"><type>node_ptr</type><template>
  1607. <template-type-parameter name="KeyType"/>
  1608. <template-type-parameter name="KeyNodePtrCompare"/>
  1609. </template><parameter name="x"><paramtype>node_ptr</paramtype></parameter><parameter name="y"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter></method>
  1610. <method name="upper_bound_loop" specifiers="static"><type>node_ptr</type><template>
  1611. <template-type-parameter name="KeyType"/>
  1612. <template-type-parameter name="KeyNodePtrCompare"/>
  1613. </template><parameter name="x"><paramtype>node_ptr</paramtype></parameter><parameter name="y"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter></method>
  1614. <method name="check_subtree" specifiers="static"><type>void</type><template>
  1615. <template-type-parameter name="Checker"/>
  1616. </template><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="checker"><paramtype>Checker</paramtype></parameter><parameter name="check_return"><paramtype>typename Checker::return_type &amp;</paramtype></parameter></method>
  1617. </method-group>
  1618. </class>
  1619. </namespace>
  1620. </namespace>
  1621. </header>
  1622. <header name="boost/intrusive/circular_list_algorithms.hpp">
  1623. <namespace name="boost">
  1624. <namespace name="intrusive">
  1625. <class name="circular_list_algorithms"><template>
  1626. <template-type-parameter name="NodeTraits"/>
  1627. </template><description><para><classname alt="boost::intrusive::circular_list_algorithms">circular_list_algorithms</classname> provides basic algorithms to manipulate nodes forming a circular doubly linked list. An empty circular list is formed by a node whose pointers point to itself.</para><para><classname alt="boost::intrusive::circular_list_algorithms">circular_list_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the circular list</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_previous(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_previous(node_ptr n, node_ptr prev);</computeroutput></para><para><computeroutput>static node_ptr get_next(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_next(node_ptr n, node_ptr next);</computeroutput> </para></description><struct name="stable_partition_info"><data-member name="num_1st_partition"><type>std::size_t</type></data-member>
  1628. <data-member name="num_2nd_partition"><type>std::size_t</type></data-member>
  1629. <data-member name="beg_2st_partition"><type>node_ptr</type></data-member>
  1630. </struct><typedef name="node"><type>NodeTraits::node</type></typedef>
  1631. <typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
  1632. <typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
  1633. <typedef name="node_traits"><type>NodeTraits</type></typedef>
  1634. <method-group name="public static functions">
  1635. <method name="init" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an non-used list element, so that inited(this_node) == true</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1636. <method name="inited" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" is in a non-used state as if it was initialized by the "init" function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1637. <method name="init_header" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty list, making this_node the only node of the circular list: <computeroutput>NodeTraits::get_next(this_node) == NodeTraits::get_previous(this_node) == this_node</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1638. <method name="unique" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" is the only node of a circular list: <computeroutput>return NodeTraits::get_next(this_node) == this_node</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1639. <method name="count" specifiers="static"><type>std::size_t</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes in a circular list. If the circular list is empty, returns 1.</para><para><emphasis role="bold">Complexity</emphasis>: Linear</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1640. <method name="unlink" specifiers="static"><type>node_ptr</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1641. <method name="unlink" specifiers="static"><type>void</type><parameter name="b"><paramtype>node_ptr</paramtype></parameter><parameter name="e"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be nodes of the same circular list or an empty range.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node [b, e) from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1642. <method name="link_before" specifiers="static"><type>void</type><parameter name="nxt_node"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: nxt_node must be a node of a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node before nxt_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1643. <method name="link_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be a node of a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node after prev_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1644. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and other_node must be nodes inserted in circular lists or be empty circular lists.</para><para><emphasis role="bold">Effects</emphasis>: Swaps the position of the nodes: this_node is inserted in other_nodes position in the second circular list and the other_node is inserted in this_node's position in the first circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1645. <method name="transfer" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="b"><paramtype>node_ptr</paramtype></parameter><parameter name="e"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be nodes of the same circular list or an empty range. and p must be a node of a different circular list or may not be an iterator in <emphasis role="bold">Effects</emphasis>: Removes the nodes from [b, e) range from their circular list and inserts them before p in p's circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1646. <method name="transfer" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="i"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: i must a node of a circular list and p must be a node of a different circular list.</para><para><emphasis role="bold">Effects</emphasis>: Removes the node i from its circular list and inserts it before p in p's circular list. If p == i or p == NodeTraits::get_next(i), this function is a null operation.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1647. <method name="reverse" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time. </para></description></method>
  1648. <method name="move_backwards" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the node p n positions towards the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of moved positions. </para></description></method>
  1649. <method name="move_forward" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the node p n positions towards the beginning of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of moved positions. </para></description></method>
  1650. <method name="distance" specifiers="static"><type>std::size_t</type><parameter name="f"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="l"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: f and l must be in a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes in the range [f, l).</para><para><emphasis role="bold">Complexity</emphasis>: Linear</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1651. <method name="stable_partition" specifiers="static"><type>void</type><template>
  1652. <template-type-parameter name="Pred"/>
  1653. </template><parameter name="beg"><paramtype>node_ptr</paramtype></parameter><parameter name="end"><paramtype>node_ptr</paramtype></parameter><parameter name="pred"><paramtype>Pred</paramtype></parameter><parameter name="info"><paramtype>stable_partition_info &amp;</paramtype></parameter></method>
  1654. </method-group>
  1655. <method-group name="private static functions">
  1656. <method name="swap_prev" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter></method>
  1657. <method name="swap_next" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter></method>
  1658. </method-group>
  1659. </class>
  1660. </namespace>
  1661. </namespace>
  1662. </header>
  1663. <header name="boost/intrusive/circular_slist_algorithms.hpp">
  1664. <namespace name="boost">
  1665. <namespace name="intrusive">
  1666. <class name="circular_slist_algorithms"><template>
  1667. <template-type-parameter name="NodeTraits"/>
  1668. </template><description><para><classname alt="boost::intrusive::circular_slist_algorithms">circular_slist_algorithms</classname> provides basic algorithms to manipulate nodes forming a circular singly linked list. An empty circular list is formed by a node whose pointer to the next node points to itself.</para><para><classname alt="boost::intrusive::circular_slist_algorithms">circular_slist_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the circular list</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_next(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_next(node_ptr n, node_ptr next);</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
  1669. <typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
  1670. <typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
  1671. <typedef name="node_traits"><type>NodeTraits</type></typedef>
  1672. <method-group name="public static functions">
  1673. <method name="init" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an non-used list element, putting the next pointer to null: <computeroutput>NodeTraits::get_next(this_node) == node_ptr()</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1674. <method name="unique" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" is the only node of a circular list: or it's a not inserted node: <computeroutput>return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1675. <method name="inited" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" has the same state as if it was inited using "init(node_ptr)"</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1676. <method name="unlink_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the next node of prev_node from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1677. <method name="unlink_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>node_ptr</paramtype></parameter><parameter name="last_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node and last_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the range (prev_node, last_node) from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1678. <method name="link_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be a node of a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node after prev_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1679. <method name="transfer_after" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="b"><paramtype>node_ptr</paramtype></parameter><parameter name="e"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be nodes of the same circular list or an empty range. and p must be a node of a different circular list.</para><para><emphasis role="bold">Effects</emphasis>: Removes the nodes from (b, e] range from their circular list and inserts them after p in p's circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1680. <method name="init_header" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty list, making this_node the only node of the circular list: <computeroutput>NodeTraits::get_next(this_node) == this_node</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1681. <method name="get_previous_node" specifiers="static"><type>node_ptr</type><parameter name="prev_init_node"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and prev_init_node must be in the same circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of this_node in the circular list starting. the search from prev_init_node. The first node checked for equality is NodeTraits::get_next(prev_init_node).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements between prev_init_node and this_node.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1682. <method name="get_previous_node" specifiers="static"><type>node_ptr</type><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of this_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1683. <method name="get_previous_previous_node" specifiers="static"><type>node_ptr</type><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the previous node of this_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1684. <method name="get_previous_previous_node" specifiers="static"><type>node_ptr</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and p must be in the same circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the previous node of this_node in the circular list starting. the search from p. The first node checked for equality is NodeTraits::get_next((NodeTraits::get_next(p)).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1685. <method name="count" specifiers="static"><type>std::size_t</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes in a circular list. If the circular list is empty, returns 1.</para><para><emphasis role="bold">Complexity</emphasis>: Linear</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1686. <method name="unlink" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list, be an empty circular list or be inited.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1687. <method name="link_before" specifiers="static"><type>void</type><parameter name="nxt_node"><paramtype>node_ptr</paramtype></parameter><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: nxt_node must be a node of a circular list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node before nxt_node in the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the circular list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1688. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and other_node must be nodes inserted in circular lists or be empty circular lists.</para><para><emphasis role="bold">Effects</emphasis>: Swaps the position of the nodes: this_node is inserted in other_nodes position in the second circular list and the other_node is inserted in this_node's position in the first circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to number of elements of both lists</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1689. <method name="reverse" specifiers="static"><type>void</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear to the contained elements. </para></description></method>
  1690. <method name="move_backwards" specifiers="static"><type>node_ptr</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the node p n positions towards the end of the list.</para><para><emphasis role="bold">Returns</emphasis>: The previous node of p after the function if there has been any movement, Null if n leads to no movement.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number moved positions. </para></description></method>
  1691. <method name="move_forward" specifiers="static"><type>node_ptr</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the node p n positions towards the beginning of the list.</para><para><emphasis role="bold">Returns</emphasis>: The previous node of p after the function if there has been any movement, Null if n leads equals to no movement.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number moved positions. </para></description></method>
  1692. </method-group>
  1693. </class>
  1694. </namespace>
  1695. </namespace>
  1696. </header>
  1697. <header name="boost/intrusive/derivation_value_traits.hpp">
  1698. <namespace name="boost">
  1699. <namespace name="intrusive">
  1700. <struct name="derivation_value_traits"><template>
  1701. <template-type-parameter name="T"/>
  1702. <template-type-parameter name="NodeTraits"/>
  1703. <template-nontype-parameter name="LinkMode"><type>link_mode_type</type><default>safe_link</default></template-nontype-parameter>
  1704. </template><description><para>This value traits template is used to create value traits from user defined node traits where value_traits::value_type will derive from node_traits::node </para></description><typedef name="node_traits"><type>NodeTraits</type></typedef>
  1705. <typedef name="value_type"><type>T</type></typedef>
  1706. <typedef name="node"><type>node_traits::node</type></typedef>
  1707. <typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
  1708. <typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
  1709. <typedef name="pointer"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::template rebind_pointer&lt; value_type &gt;::type</type></typedef>
  1710. <typedef name="const_pointer"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::template rebind_pointer&lt; const value_type &gt;::type</type></typedef>
  1711. <typedef name="reference"><type><classname>boost::intrusive::pointer_traits</classname>&lt; pointer &gt;::reference</type></typedef>
  1712. <typedef name="const_reference"><type><classname>boost::intrusive::pointer_traits</classname>&lt; const_pointer &gt;::reference</type></typedef>
  1713. <data-member name="link_mode" specifiers="static"><type>const link_mode_type</type></data-member>
  1714. <method-group name="public static functions">
  1715. <method name="to_node_ptr" specifiers="static"><type>node_ptr</type><parameter name="value"><paramtype>reference</paramtype></parameter></method>
  1716. <method name="to_node_ptr" specifiers="static"><type>const_node_ptr</type><parameter name="value"><paramtype>const_reference</paramtype></parameter></method>
  1717. <method name="to_value_ptr" specifiers="static"><type>pointer</type><parameter name="n"><paramtype>const node_ptr &amp;</paramtype></parameter></method>
  1718. <method name="to_value_ptr" specifiers="static"><type>const_pointer</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter></method>
  1719. </method-group>
  1720. </struct>
  1721. </namespace>
  1722. </namespace>
  1723. </header>
  1724. <header name="boost/intrusive/hashtable.hpp">
  1725. <namespace name="boost">
  1726. <namespace name="intrusive">
  1727. <class name="hashtable"><template>
  1728. <template-type-parameter name="T"/>
  1729. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1730. </template><inherit access="private">hashtable_size_traits_wrapper&lt; hashdata_internal&lt; ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags &amp;(hash_bool_flags::incremental_pos|hash_bool_flags::cache_begin_pos) &gt;, SizeType,(BoolFlags &amp;hash_bool_flags::constant_time_size_pos) !=0 &gt;</inherit><description><para>The class template hashtable is an intrusive hash table container, that is used to construct intrusive <classname alt="boost::intrusive::unordered_set">unordered_set</classname> and <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> containers. The no-throw guarantee holds only, if the VoidOrKeyEqual object and Hasher don't throw.</para><para>hashtable is a semi-intrusive container: each object to be stored in the container must contain a proper hook, but the container also needs additional auxiliary memory to work: hashtable needs a pointer to an array of type <computeroutput>bucket_type</computeroutput> to be passed in the constructor. This bucket array must have at least the same lifetime as the container. This makes the use of hashtable more complicated than purely intrusive containers. <computeroutput>bucket_type</computeroutput> is default-constructible, copyable and assignable</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>hash&lt;&gt;</computeroutput> and <computeroutput>equal&lt;&gt;</computeroutput> <computeroutput>bucket_traits&lt;&gt;</computeroutput>, power_2_buckets&lt;&gt;, cache_begin&lt;&gt; and incremental&lt;&gt;.</para><para>hashtable only provides forward iterators but it provides 4 iterator types: iterator and const_iterator to navigate through the whole container and local_iterator and const_local_iterator to navigate through the values stored in a single bucket. Local iterators are faster and smaller.</para><para>It's not recommended to use non constant-time size hashtables because several key functions, like "empty()", become non-constant time functions. Non constant_time size hashtables are mainly provided to support auto-unlink hooks.</para><para>hashtables, does not make automatic rehashings nor offers functions related to a load factor. Rehashing can be explicitly requested and the user must provide a new bucket array that will be used from that moment.</para><para>Since no automatic rehashing is done, iterators are never invalidated when inserting or erasing elements. Iterators are only invalidated when rehashing. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
  1731. <typedef name="pointer"><type>value_traits::pointer</type></typedef>
  1732. <typedef name="const_pointer"><type>value_traits::const_pointer</type></typedef>
  1733. <typedef name="value_type"><type>value_traits::value_type</type></typedef>
  1734. <typedef name="key_type"><type>hash_types_base::key_type</type></typedef>
  1735. <typedef name="key_of_value"><type>hash_types_base::key_of_value</type></typedef>
  1736. <typedef name="reference"><type><classname>pointer_traits</classname>&lt; pointer &gt;::reference</type></typedef>
  1737. <typedef name="const_reference"><type><classname>pointer_traits</classname>&lt; const_pointer &gt;::reference</type></typedef>
  1738. <typedef name="difference_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::difference_type</type></typedef>
  1739. <typedef name="size_type"><type>SizeType</type></typedef>
  1740. <typedef name="key_equal"><type>internal_type::key_equal</type></typedef>
  1741. <typedef name="hasher"><type>internal_type::hasher</type></typedef>
  1742. <typedef name="bucket_type"><type>bucket_impl&lt; <classname>slist</classname> &gt;</type></typedef>
  1743. <typedef name="bucket_ptr"><type>internal_type::bucket_ptr</type></typedef>
  1744. <typedef name="siterator"><type>slist::iterator</type></typedef>
  1745. <typedef name="const_siterator"><type>slist::const_iterator</type></typedef>
  1746. <typedef name="iterator"><type>internal_type::iterator</type></typedef>
  1747. <typedef name="const_iterator"><type>internal_type::const_iterator</type></typedef>
  1748. <typedef name="local_iterator"><type>internal_type::local_iterator</type></typedef>
  1749. <typedef name="const_local_iterator"><type>internal_type::const_local_iterator</type></typedef>
  1750. <typedef name="node_traits"><type>value_traits::node_traits</type></typedef>
  1751. <typedef name="node"><type>node_traits::node</type></typedef>
  1752. <typedef name="node_ptr"><type><classname>pointer_traits</classname>&lt; pointer &gt;::template rebind_pointer&lt; node &gt;::type</type></typedef>
  1753. <typedef name="const_node_ptr"><type><classname>pointer_traits</classname>&lt; pointer &gt;::template rebind_pointer&lt; const node &gt;::type</type></typedef>
  1754. <typedef name="node_reference"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::reference</type></typedef>
  1755. <typedef name="const_node_reference"><type><classname>pointer_traits</classname>&lt; const_node_ptr &gt;::reference</type></typedef>
  1756. <typedef name="node_algorithms"><type>slist::node_algorithms</type></typedef>
  1757. <typedef name="insert_commit_data"><type><emphasis>unspecified</emphasis></type></typedef>
  1758. <data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
  1759. <data-member name="store_hash" specifiers="static"><type>const bool</type></data-member>
  1760. <data-member name="unique_keys" specifiers="static"><type>const bool</type></data-member>
  1761. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  1762. <data-member name="cache_begin" specifiers="static"><type>const bool</type></data-member>
  1763. <data-member name="compare_hash" specifiers="static"><type>const bool</type></data-member>
  1764. <data-member name="incremental" specifiers="static"><type>const bool</type></data-member>
  1765. <data-member name="power_2_buckets" specifiers="static"><type>const bool</type></data-member>
  1766. <data-member name="optimize_multikey" specifiers="static"><type>const bool</type></data-member>
  1767. <method-group name="public member functions">
  1768. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1769. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1770. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1771. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1772. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1773. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1774. <method name="hash_function" cv="const"><type>hasher</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the hasher object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hasher copy-constructor throws. </para></description></method>
  1775. <method name="key_eq" cv="const"><type>key_equal</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_equal object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_equal copy-constructor throws. </para></description></method>
  1776. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: if constant-time size and <classname alt="boost::intrusive::cache_begin">cache_begin</classname> options are disabled, average constant time (worst case, with empty() == true: O(this-&gt;bucket_count()). Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1777. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is false. Constant-time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1778. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>hashtable</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: the hasher and the equality function unqualified swap call should not throw.</para><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two unordered_sets. Swaps also the contained bucket array and equality and hasher functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the swap() call for the comparison or hash functors found using ADL throw. Basic guarantee. </para></description></method>
  1779. <method name="clone_from"><type>void</type><template>
  1780. <template-type-parameter name="Cloner"/>
  1781. <template-type-parameter name="Disposer"/>
  1782. </template><parameter name="src"><paramtype>const <classname>hashtable</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
  1783. <method name="clone_from"><type>void</type><template>
  1784. <template-type-parameter name="Cloner"/>
  1785. <template-type-parameter name="Disposer"/>
  1786. </template><parameter name="src"><paramtype><classname>hashtable</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
  1787. <method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value into the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the inserted value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1788. <method name="insert_equal"><type>void</type><template>
  1789. <template-type-parameter name="Iterator"/>
  1790. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Equivalent to this-&gt;insert_equal(t) for each element in [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(N), where N is distance(b, e). Worst case O(N*this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1791. <method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Tries to inserts value into the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Returns</emphasis>: If the value is not already present inserts it and returns a pair containing the iterator to the new value and true. If there is an equivalent value returns a pair containing an iterator to the already present value and false.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1792. <method name="insert_unique"><type>void</type><template>
  1793. <template-type-parameter name="Iterator"/>
  1794. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Equivalent to this-&gt;insert_unique(t) for each element in [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(N), where N is distance(b, e). Worst case O(N*this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  1795. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  1796. <template-type-parameter name="KeyType"/>
  1797. <template-type-parameter name="KeyHasher"/>
  1798. <template-type-parameter name="KeyEqual"/>
  1799. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the hash or the equality is much cheaper to construct than the value_type and this function offers the possibility to use that the part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time.</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
  1800. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hasher or key_compare throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the hash or the equality is much cheaper to construct than the value_type and this function offers the possibility to use that the part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time.</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
  1801. <method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
  1802. <method name="erase"><type>void</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. No destructors are called. </para></description></method>
  1803. <method name="erase"><type>void</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1804. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1805. <method name="erase"><type>size_type</type><template>
  1806. <template-type-parameter name="KeyType"/>
  1807. <template-type-parameter name="KeyHasher"/>
  1808. <template-type-parameter name="KeyEqual"/>
  1809. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements that have the same hash and compare equal with the given key.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1810. <method name="erase_and_dispose"><type>void</type><template>
  1811. <template-type-parameter name="Disposer"/>
  1812. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  1813. <method name="erase_and_dispose"><type>void</type><template>
  1814. <template-type-parameter name="Disposer"/>
  1815. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  1816. <method name="erase_and_dispose"><type>size_type</type><template>
  1817. <template-type-parameter name="Disposer"/>
  1818. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1819. <method name="erase_and_dispose"><type>size_type</type><template>
  1820. <template-type-parameter name="KeyType"/>
  1821. <template-type-parameter name="KeyHasher"/>
  1822. <template-type-parameter name="KeyEqual"/>
  1823. <template-type-parameter name="Disposer"/>
  1824. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "equal_func". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  1825. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1826. <method name="clear_and_dispose"><type>void</type><template>
  1827. <template-type-parameter name="Disposer"/>
  1828. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  1829. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  1830. <method name="count" cv="const"><type>size_type</type><template>
  1831. <template-type-parameter name="KeyType"/>
  1832. <template-type-parameter name="KeyHasher"/>
  1833. <template-type-parameter name="KeyEqual"/>
  1834. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal throw. </para></description></method>
  1835. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element is equal to "value" or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  1836. <method name="find"><type>iterator</type><template>
  1837. <template-type-parameter name="KeyType"/>
  1838. <template-type-parameter name="KeyHasher"/>
  1839. <template-type-parameter name="KeyEqual"/>
  1840. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hash and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  1841. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a const_iterator to the first element whose key is "key" or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  1842. <method name="find" cv="const"><type>const_iterator</type><template>
  1843. <template-type-parameter name="KeyType"/>
  1844. <template-type-parameter name="KeyHasher"/>
  1845. <template-type-parameter name="KeyEqual"/>
  1846. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hasher and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  1847. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  1848. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  1849. <template-type-parameter name="KeyType"/>
  1850. <template-type-parameter name="KeyHasher"/>
  1851. <template-type-parameter name="KeyEqual"/>
  1852. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or the equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  1853. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  1854. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  1855. <template-type-parameter name="KeyType"/>
  1856. <template-type-parameter name="KeyHasher"/>
  1857. <template-type-parameter name="KeyEqual"/>
  1858. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the hasher or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  1859. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
  1860. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
  1861. <method name="local_iterator_to"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1862. <method name="local_iterator_to" cv="const"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1863. <method name="bucket_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of buckets passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1864. <method name="bucket_size" cv="const"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements in the nth bucket.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1865. <method name="bucket" cv="const"><type>size_type</type><parameter name="k"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the hash functor throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
  1866. <method name="bucket" cv="const"><type>size_type</type><template>
  1867. <template-type-parameter name="KeyType"/>
  1868. <template-type-parameter name="KeyHasher"/>
  1869. </template><parameter name="k"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hash_func throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
  1870. <method name="bucket_pointer" cv="const"><type>bucket_ptr</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the bucket array pointer passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1871. <method name="begin"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  1872. <method name="begin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  1873. <method name="cbegin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  1874. <method name="end"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  1875. <method name="end" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  1876. <method name="cend" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  1877. <method name="rehash"><type>void</type><parameter name="new_bucket_traits"><paramtype>const <classname>bucket_traits</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_bucket_traits can hold a pointer to a new bucket array or the same as the old bucket array with a different length. new_size is the length of the the array pointed by new_buckets. If new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer() new_bucket_traits.bucket_count() can be bigger or smaller than this-&gt;bucket_count(). 'new_bucket_traits' copy constructor should not throw.</para><para><emphasis role="bold">Effects</emphasis>: If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is false, unlinks values from the old bucket and inserts then in the new one according to the hash value of values.</para><para>If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is true, the implementations avoids moving values as much as possible.</para><para>Bucket traits hold by *this is assigned from new_bucket_traits. If the container is configured as incremental&lt;&gt;, the split bucket is set to the new bucket_count().</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function. If false, the implementation tries to minimize calls to the hash function (e.g. once for equivalent values if optimize_multikey&lt;true&gt; is true).</para><para>If rehash is successful updates the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> with new_bucket_traits.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
  1878. <method name="full_rehash"><type>void</type><description><para><emphasis role="bold">Note</emphasis>: This function is used when keys from inserted elements are changed (e.g. a language change when key is a string) but uniqueness and hash properties are preserved so a fast full rehash recovers invariants for *this without extracting and reinserting all elements again.</para><para><emphasis role="bold">Requires</emphasis>: Calls produced to the hash function should not alter the value uniqueness properties of already inserted elements. If hasher(key1) == hasher(key2) was true when elements were inserted, it shall be true during calls produced in the execution of this function.</para><para>key_equal is not called inside this function so it is assumed that key_equal(value1, value2) should produce the same results as before for inserted elements.</para><para><emphasis role="bold">Effects</emphasis>: Reprocesses all values hold by *this, recalculating their hash values and redistributing them though the buckets.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method uses the hash function and updates the stored hash value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
  1879. <method name="incremental_rehash"><type>bool</type><parameter name="grow"><paramtype>bool</paramtype><default>true</default></parameter><description><para><emphasis role="bold">Requires</emphasis>:</para><para><emphasis role="bold">Effects</emphasis>:</para><para><emphasis role="bold">Complexity</emphasis>:</para><para><emphasis role="bold">Throws</emphasis>:</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description><description><para>grow </para></description></method>
  1880. <method name="incremental_rehash"><type>bool</type><parameter name="new_bucket_traits"><paramtype>const <classname>bucket_traits</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If new_bucket_traits.bucket_count() is not this-&gt;bucket_count()/2 or this-&gt;bucket_count()*2, or this-&gt;split_bucket() != new_bucket_traits.bucket_count() returns false and does nothing.</para><para>Otherwise, copy assigns new_bucket_traits to the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> and transfers all the objects from old buckets to the new ones.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to size().</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
  1881. <method name="split_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Requires</emphasis>: incremental&lt;&gt; option must be set</para><para><emphasis role="bold">Effects</emphasis>: returns the current split count</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing </para></description></method>
  1882. </method-group>
  1883. <constructor specifiers="explicit"><parameter name="b_traits"><paramtype>const <classname>bucket_traits</classname> &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
  1884. <constructor><template>
  1885. <template-type-parameter name="Iterator"/>
  1886. </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="b_traits"><paramtype>const <classname>bucket_traits</classname> &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource and dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: If N is distance(b, e): Average case is O(N) (with a good hash function and with buckets_len &gt;= N),worst case O(N^2).</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hasher or key_equal throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
  1887. <constructor><parameter name="x"><paramtype><classname>hashtable</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal value traits, bucket traits, hasher and comparison are move constructed and nodes belonging to x are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of value traits, bucket traits, hasher or comparison throws. </para></description></constructor>
  1888. <copy-assignment><type><classname>hashtable</classname> &amp;</type><parameter name="x"><paramtype><classname>hashtable</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap. </para></description></copy-assignment>
  1889. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> are not deleted (i.e. no destructors are called).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, if it's a safe-mode or auto-unlink value. Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  1890. <method-group name="public static functions">
  1891. <method name="s_local_iterator_to" specifiers="static"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  1892. <method name="s_local_iterator_to" specifiers="static"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  1893. <method name="suggested_upper_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is bigger or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the higher possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1894. <method name="suggested_lower_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is smaller or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the lowest possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1895. </method-group>
  1896. </class><struct name="make_hashtable"><template>
  1897. <template-type-parameter name="T"/>
  1898. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1899. </template><description><para>Helper metafunction to define a <computeroutput>hashtable</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  1900. </struct>
  1901. </namespace>
  1902. </namespace>
  1903. </header>
  1904. <header name="boost/intrusive/intrusive_fwd.hpp">
  1905. <para>This header file forward declares most Intrusive classes.</para><para>It forward declares the following containers and hooks:<itemizedlist>
  1906. <listitem><para><classname alt="boost::intrusive::slist">boost::intrusive::slist</classname> / <classname alt="boost::intrusive::slist_base_hook">boost::intrusive::slist_base_hook</classname> / <classname alt="boost::intrusive::slist_member_hook">boost::intrusive::slist_member_hook</classname></para>
  1907. </listitem><listitem><para><classname alt="boost::intrusive::list">boost::intrusive::list</classname> / <classname alt="boost::intrusive::list_base_hook">boost::intrusive::list_base_hook</classname> / <classname alt="boost::intrusive::list_member_hook">boost::intrusive::list_member_hook</classname></para>
  1908. </listitem><listitem><para><classname alt="boost::intrusive::bstree">boost::intrusive::bstree</classname> / <classname alt="boost::intrusive::bs_set">boost::intrusive::bs_set</classname> / <classname alt="boost::intrusive::bs_multiset">boost::intrusive::bs_multiset</classname> / <classname alt="boost::intrusive::bs_set_base_hook">boost::intrusive::bs_set_base_hook</classname> / <classname alt="boost::intrusive::bs_set_member_hook">boost::intrusive::bs_set_member_hook</classname></para>
  1909. </listitem><listitem><para><classname alt="boost::intrusive::rbtree">boost::intrusive::rbtree</classname> / <classname alt="boost::intrusive::set">boost::intrusive::set</classname> / <classname alt="boost::intrusive::multiset">boost::intrusive::multiset</classname> / <classname alt="boost::intrusive::set_base_hook">boost::intrusive::set_base_hook</classname> / <classname alt="boost::intrusive::set_member_hook">boost::intrusive::set_member_hook</classname></para>
  1910. </listitem><listitem><para><classname alt="boost::intrusive::avltree">boost::intrusive::avltree</classname> / <classname alt="boost::intrusive::avl_set">boost::intrusive::avl_set</classname> / <classname alt="boost::intrusive::avl_multiset">boost::intrusive::avl_multiset</classname> / <classname alt="boost::intrusive::avl_set_base_hook">boost::intrusive::avl_set_base_hook</classname> / <classname alt="boost::intrusive::avl_set_member_hook">boost::intrusive::avl_set_member_hook</classname></para>
  1911. </listitem><listitem><para><classname alt="boost::intrusive::splaytree">boost::intrusive::splaytree</classname> / <classname alt="boost::intrusive::splay_set">boost::intrusive::splay_set</classname> / <classname alt="boost::intrusive::splay_multiset">boost::intrusive::splay_multiset</classname></para>
  1912. </listitem><listitem><para><classname alt="boost::intrusive::sgtree">boost::intrusive::sgtree</classname> / <classname alt="boost::intrusive::sg_set">boost::intrusive::sg_set</classname> / <classname alt="boost::intrusive::sg_multiset">boost::intrusive::sg_multiset</classname></para>
  1913. </listitem><listitem><para><classname alt="boost::intrusive::treap">boost::intrusive::treap</classname> / <classname alt="boost::intrusive::treap_set">boost::intrusive::treap_set</classname> / <classname alt="boost::intrusive::treap_multiset">boost::intrusive::treap_multiset</classname></para>
  1914. </listitem><listitem><para><classname alt="boost::intrusive::hashtable">boost::intrusive::hashtable</classname> / <classname alt="boost::intrusive::unordered_set">boost::intrusive::unordered_set</classname> / <classname alt="boost::intrusive::unordered_multiset">boost::intrusive::unordered_multiset</classname> / <classname alt="boost::intrusive::unordered_set_base_hook">boost::intrusive::unordered_set_base_hook</classname> / <classname alt="boost::intrusive::unordered_set_member_hook">boost::intrusive::unordered_set_member_hook</classname> /</para>
  1915. </listitem><listitem><para><classname alt="boost::intrusive::any_base_hook">boost::intrusive::any_base_hook</classname> / <classname alt="boost::intrusive::any_member_hook">boost::intrusive::any_member_hook</classname></para>
  1916. </listitem></itemizedlist>
  1917. </para><para>It forward declares the following container or hook options:<itemizedlist>
  1918. <listitem><para><classname alt="boost::intrusive::constant_time_size">boost::intrusive::constant_time_size</classname> / <classname alt="boost::intrusive::size_type">boost::intrusive::size_type</classname> / <classname alt="boost::intrusive::compare">boost::intrusive::compare</classname> / <classname alt="boost::intrusive::equal">boost::intrusive::equal</classname></para>
  1919. </listitem><listitem><para><classname alt="boost::intrusive::floating_point">boost::intrusive::floating_point</classname> / <classname alt="boost::intrusive::priority">boost::intrusive::priority</classname> / <classname alt="boost::intrusive::hash">boost::intrusive::hash</classname></para>
  1920. </listitem><listitem><para><classname alt="boost::intrusive::value_traits">boost::intrusive::value_traits</classname> / <classname alt="boost::intrusive::member_hook">boost::intrusive::member_hook</classname> / <classname alt="boost::intrusive::function_hook">boost::intrusive::function_hook</classname> / <classname alt="boost::intrusive::base_hook">boost::intrusive::base_hook</classname></para>
  1921. </listitem><listitem><para><classname alt="boost::intrusive::void_pointer">boost::intrusive::void_pointer</classname> / <classname alt="boost::intrusive::tag">boost::intrusive::tag</classname> / <classname alt="boost::intrusive::link_mode">boost::intrusive::link_mode</classname></para>
  1922. </listitem><listitem><para><classname alt="boost::intrusive::optimize_size">boost::intrusive::optimize_size</classname> / <classname alt="boost::intrusive::linear">boost::intrusive::linear</classname> / <classname alt="boost::intrusive::cache_last">boost::intrusive::cache_last</classname></para>
  1923. </listitem><listitem><para><classname alt="boost::intrusive::bucket_traits">boost::intrusive::bucket_traits</classname> / <classname alt="boost::intrusive::store_hash">boost::intrusive::store_hash</classname> / <classname alt="boost::intrusive::optimize_multikey">boost::intrusive::optimize_multikey</classname></para>
  1924. </listitem><listitem><para><classname alt="boost::intrusive::power_2_buckets">boost::intrusive::power_2_buckets</classname> / <classname alt="boost::intrusive::cache_begin">boost::intrusive::cache_begin</classname> / <classname alt="boost::intrusive::compare_hash">boost::intrusive::compare_hash</classname> / <classname alt="boost::intrusive::incremental">boost::intrusive::incremental</classname></para>
  1925. </listitem></itemizedlist>
  1926. </para><para>It forward declares the following value traits utilities:<itemizedlist>
  1927. <listitem><para><classname alt="boost::intrusive::value_traits">boost::intrusive::value_traits</classname> / <classname alt="boost::intrusive::derivation_value_traits">boost::intrusive::derivation_value_traits</classname> / <classname alt="boost::intrusive::trivial_value_traits">boost::intrusive::trivial_value_traits</classname></para>
  1928. </listitem></itemizedlist>
  1929. </para><para>Finally it forward declares the following general purpose utilities:<itemizedlist>
  1930. <listitem><para><classname alt="boost::intrusive::pointer_plus_bits">boost::intrusive::pointer_plus_bits</classname> / boost::intrusive::priority_compare. </para>
  1931. </listitem></itemizedlist>
  1932. </para></header>
  1933. <header name="boost/intrusive/linear_slist_algorithms.hpp">
  1934. <namespace name="boost">
  1935. <namespace name="intrusive">
  1936. <class name="linear_slist_algorithms"><template>
  1937. <template-type-parameter name="NodeTraits"/>
  1938. </template><description><para><classname alt="boost::intrusive::linear_slist_algorithms">linear_slist_algorithms</classname> provides basic algorithms to manipulate nodes forming a linear singly linked list.</para><para><classname alt="boost::intrusive::linear_slist_algorithms">linear_slist_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the linear list</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_next(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_next(node_ptr n, node_ptr next);</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
  1939. <typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
  1940. <typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
  1941. <typedef name="node_traits"><type>NodeTraits</type></typedef>
  1942. <method-group name="public static functions">
  1943. <method name="init" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an non-used list element, putting the next pointer to null: <computeroutput>NodeTraits::get_next(this_node) == node_ptr()</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1944. <method name="unique" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" is the only node of a circular list: or it's a not inserted node: <computeroutput>return node_ptr() == NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</computeroutput></para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1945. <method name="inited" specifiers="static"><type>bool</type><parameter name="this_node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns true is "this_node" has the same state as if it was inited using "init(node_ptr)"</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1946. <method name="unlink_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the next node of prev_node from the circular list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1947. <method name="unlink_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="last_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node and last_node must be in a circular list or be an empty circular list.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the range (prev_node, last_node) from the linear list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1948. <method name="link_after" specifiers="static"><type>void</type><parameter name="prev_node"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_node must be a node of a linear list.</para><para><emphasis role="bold">Effects</emphasis>: Links this_node after prev_node in the linear list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1949. <method name="transfer_after" specifiers="static"><type>void</type><parameter name="p"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="b"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="e"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be nodes of the same linear list or an empty range. and p must be a node of a different linear list.</para><para><emphasis role="bold">Effects</emphasis>: Removes the nodes from (b, e] range from their linear list and inserts them after p in p's linear list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1950. <method name="init_header" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty list, making this_node the only node of the circular list: <computeroutput>NodeTraits::get_next(this_node) == this_node</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1951. <method name="get_previous_node" specifiers="static"><type>node_ptr</type><parameter name="prev_init_node"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="this_node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and prev_init_node must be in the same linear list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of this_node in the linear list starting. the search from prev_init_node. The first node checked for equality is NodeTraits::get_next(prev_init_node).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements between prev_init_node and this_node.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1952. <method name="count" specifiers="static"><type>std::size_t</type><parameter name="this_node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node must be in a linear list or be an empty linear list.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes in a linear list. If the linear list is empty, returns 1.</para><para><emphasis role="bold">Complexity</emphasis>: Linear</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1953. <method name="swap_trailing_nodes" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: this_node and other_node must be nodes inserted in linear lists or be empty linear lists.</para><para><emphasis role="bold">Effects</emphasis>: Moves all the nodes previously chained after this_node after other_node and vice-versa.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  1954. <method name="reverse" specifiers="static"><type>node_ptr</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Returns</emphasis>: The new first node of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear to the contained elements. </para></description></method>
  1955. <method name="move_first_n_backwards" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the first n nodes starting at p to the end of the list.</para><para><emphasis role="bold">Returns</emphasis>: A pair containing the new first and last node of the list or if there has been any movement, a null pair if n leads to no movement.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number moved positions. </para></description></method>
  1956. <method name="move_first_n_forward" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><parameter name="p"><paramtype>node_ptr</paramtype></parameter><parameter name="n"><paramtype>std::size_t</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves the first n nodes starting at p to the beginning of the list.</para><para><emphasis role="bold">Returns</emphasis>: A pair containing the new first and last node of the list or if there has been any movement, a null pair if n leads to no movement.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number moved positions. </para></description></method>
  1957. </method-group>
  1958. </class>
  1959. </namespace>
  1960. </namespace>
  1961. </header>
  1962. <header name="boost/intrusive/link_mode.hpp">
  1963. <namespace name="boost">
  1964. <namespace name="intrusive">
  1965. <enum name="link_mode_type"><enumvalue name="normal_link"><description><para>If this linking policy is specified in a <classname alt="boost::intrusive::value_traits">value_traits</classname> class as the <classname alt="boost::intrusive::link_mode">link_mode</classname>, containers configured with such <classname alt="boost::intrusive::value_traits">value_traits</classname> won't set the hooks of the erased values to a default state. Containers also won't check that the hooks of the new values are default initialized. </para></description></enumvalue><enumvalue name="safe_link"><description><para>If this linking policy is specified in a <classname alt="boost::intrusive::value_traits">value_traits</classname> class as the <classname alt="boost::intrusive::link_mode">link_mode</classname>, containers configured with such <classname alt="boost::intrusive::value_traits">value_traits</classname> will set the hooks of the erased values to a default state. Containers also will check that the hooks of the new values are default initialized. </para></description></enumvalue><enumvalue name="auto_unlink"><description><para>Same as "safe_link" but the user type is an auto-unlink type, so the containers with constant-time size features won't be compatible with <classname alt="boost::intrusive::value_traits">value_traits</classname> configured with this policy. Containers also know that the a value can be silently erased from the container without using any function provided by the containers. </para></description></enumvalue><description><para>This enumeration defines the type of <classname alt="boost::intrusive::value_traits">value_traits</classname> that can be defined for Boost.Intrusive containers </para></description></enum>
  1966. </namespace>
  1967. </namespace>
  1968. </header>
  1969. <header name="boost/intrusive/list.hpp">
  1970. <namespace name="boost">
  1971. <namespace name="intrusive">
  1972. <class name="list"><template>
  1973. <template-type-parameter name="T"/>
  1974. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  1975. </template><description><para>The class template list is an intrusive container that mimics most of the interface of std::list as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput> and <computeroutput>size_type&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
  1976. <typedef name="pointer"><type>value_traits::pointer</type></typedef>
  1977. <typedef name="const_pointer"><type>value_traits::const_pointer</type></typedef>
  1978. <typedef name="value_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::element_type</type></typedef>
  1979. <typedef name="reference"><type><classname>pointer_traits</classname>&lt; pointer &gt;::reference</type></typedef>
  1980. <typedef name="const_reference"><type><classname>pointer_traits</classname>&lt; const_pointer &gt;::reference</type></typedef>
  1981. <typedef name="difference_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::difference_type</type></typedef>
  1982. <typedef name="size_type"><type>SizeType</type></typedef>
  1983. <typedef name="iterator"><type>list_iterator&lt; value_traits, false &gt;</type></typedef>
  1984. <typedef name="const_iterator"><type>list_iterator&lt; value_traits, true &gt;</type></typedef>
  1985. <typedef name="reverse_iterator"><type>boost::intrusive::reverse_iterator&lt; iterator &gt;</type></typedef>
  1986. <typedef name="const_reverse_iterator"><type>boost::intrusive::reverse_iterator&lt; const_iterator &gt;</type></typedef>
  1987. <typedef name="node_traits"><type>value_traits::node_traits</type></typedef>
  1988. <typedef name="node"><type>node_traits::node</type></typedef>
  1989. <typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
  1990. <typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
  1991. <typedef name="node_algorithms"><type><classname>circular_list_algorithms</classname>&lt; node_traits &gt;</type></typedef>
  1992. <typedef name="header_holder_type"><type><emphasis>unspecified</emphasis></type></typedef>
  1993. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  1994. <data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
  1995. <data-member name="has_container_from_iterator" specifiers="static"><type>const bool</type></data-member>
  1996. <method-group name="public member functions">
  1997. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the back of the list. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  1998. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the front of the list. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  1999. <method name="pop_back"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases the last element of the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  2000. <method name="pop_back_and_dispose"><type>void</type><template>
  2001. <template-type-parameter name="Disposer"/>
  2002. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the last element of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
  2003. <method name="pop_front"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases the first element of the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  2004. <method name="pop_front_and_dispose"><type>void</type><template>
  2005. <template-type-parameter name="Disposer"/>
  2006. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the first element of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
  2007. <method name="front"><type>reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reference to the first element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2008. <method name="front" cv="const"><type>const_reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reference to the first element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2009. <method name="back"><type>reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reference to the last element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2010. <method name="back" cv="const"><type>const_reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reference to the last element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2011. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2012. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2013. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2014. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2015. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2016. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a constant iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2017. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2018. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2019. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2020. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2021. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2022. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2023. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of the elements contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements contained in the list. if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  2024. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the list contains no elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  2025. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>list</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the elements of x and *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  2026. <method name="shift_backwards"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><default>1</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves backwards all the elements, so that the first element becomes the second, the second becomes the third... the last element becomes the first one.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of shifts.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  2027. <method name="shift_forward"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><default>1</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves forward all the elements, so that the second element becomes the first, the third becomes the second... the first element becomes the last one.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of shifts.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  2028. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed by i of the list. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed element, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  2029. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be valid iterators to elements in *this.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element range pointed by b and e No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of erased elements if it's a safe-mode or auto-unlink value, or constant-time size is enabled. Constant-time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  2030. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: b and e must be valid iterators to elements in *this. n must be distance(b, e).</para><para><emphasis role="bold">Effects</emphasis>: Erases the element range pointed by b and e No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of erased elements if it's a safe-mode or auto-unlink value is enabled. Constant-time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  2031. <method name="erase_and_dispose"><type>iterator</type><template>
  2032. <template-type-parameter name="Disposer"/>
  2033. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed by i of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed element, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
  2034. <method name="erase_and_dispose"><type>iterator</type><template>
  2035. <template-type-parameter name="Disposer"/>
  2036. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element range pointed by b and e No destructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements erased.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  2037. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements of the container. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of the list. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  2038. <method name="clear_and_dispose"><type>void</type><template>
  2039. <template-type-parameter name="Disposer"/>
  2040. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements of the container. No destructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of the list.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  2041. <method name="clone_from"><type>void</type><template>
  2042. <template-type-parameter name="Cloner"/>
  2043. <template-type-parameter name="Disposer"/>
  2044. </template><parameter name="src"><paramtype>const <classname>list</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws. Basic guarantee. </para></description></method>
  2045. <method name="clone_from"><type>void</type><template>
  2046. <template-type-parameter name="Cloner"/>
  2047. <template-type-parameter name="Disposer"/>
  2048. </template><parameter name="src"><paramtype><classname>list</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws. Basic guarantee. </para></description></method>
  2049. <method name="insert"><type>iterator</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and p must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value before the position pointed by p.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the inserted element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time. No copy constructors are called.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  2050. <method name="insert"><type>void</type><template>
  2051. <template-type-parameter name="Iterator"/>
  2052. </template><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type and p must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the range pointed by b and e before the position p. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  2053. <method name="assign"><type>void</type><template>
  2054. <template-type-parameter name="Iterator"/>
  2055. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements contained in the list if it's a safe-mode or auto-unlink value. Linear to the number of elements inserted in the list otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  2056. <method name="dispose_and_assign"><type>void</type><template>
  2057. <template-type-parameter name="Iterator"/>
  2058. <template-type-parameter name="Disposer"/>
  2059. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements contained in the list.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  2060. <method name="splice"><type>void</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Transfers all the elements of list x to this list, before the the element pointed by p. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  2061. <method name="splice"><type>void</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><parameter name="new_ele"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a valid iterator of *this. new_ele must point to an element contained in list x.</para><para><emphasis role="bold">Effects</emphasis>: Transfers the value pointed by new_ele, from list x to this list, before the element pointed by p. No destructors or copy constructors are called. If p == new_ele or p == ++new_ele, this function is a null operation.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  2062. <method name="splice"><type>void</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a valid iterator of *this. f and e must point to elements contained in list x.</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range pointed by f and e from list x to this list, before the element pointed by p. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements transferred if constant-time size option is enabled. Constant-time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  2063. <method name="splice"><type>void</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a valid iterator of *this. f and e must point to elements contained in list x. n == distance(f, e)</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range pointed by f and e from list x to this list, before the element pointed by p. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  2064. <method name="sort"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: This function sorts the list *this according to std::less&lt;value_type&gt;. The sort is stable, that is, the relative order of equivalent elements is preserved.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or std::less&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Notes</emphasis>: Iterators and references are not invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: The number of comparisons is approximately N log N, where N is the list's size. </para></description></method>
  2065. <method name="sort"><type>void</type><template>
  2066. <template-type-parameter name="Predicate"/>
  2067. </template><parameter name="p"><paramtype>Predicate</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a comparison function that induces a strict weak ordering</para><para><emphasis role="bold">Effects</emphasis>: This function sorts the list *this according to p. The sort is stable, that is, the relative order of equivalent elements is preserved.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This won't throw if list_base_hook&lt;&gt; or <classname alt="boost::intrusive::list_member_hook">list_member_hook</classname> are used. Iterators and references are not invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: The number of comparisons is approximately N log N, where N is the list's size. </para></description></method>
  2068. <method name="merge"><type>void</type><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this according to std::less&lt;value_type&gt;. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Throws</emphasis>: If std::less&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
  2069. <method name="merge"><type>void</type><template>
  2070. <template-type-parameter name="Predicate"/>
  2071. </template><parameter name="x"><paramtype><classname>list</classname> &amp;</paramtype></parameter><parameter name="p"><paramtype>Predicate</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.</para><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
  2072. <method name="reverse"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
  2073. <method name="remove"><type>void</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes all the elements that compare equal to value. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  2074. <method name="remove_and_dispose"><type>void</type><template>
  2075. <template-type-parameter name="Disposer"/>
  2076. </template><parameter name="value"><paramtype>const_reference</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes all the elements that compare equal to value. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  2077. <method name="remove_if"><type>void</type><template>
  2078. <template-type-parameter name="Pred"/>
  2079. </template><parameter name="pred"><paramtype>Pred</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes all the elements for which a specified predicate is satisfied. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() calls to the predicate.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  2080. <method name="remove_and_dispose_if"><type>void</type><template>
  2081. <template-type-parameter name="Pred"/>
  2082. <template-type-parameter name="Disposer"/>
  2083. </template><parameter name="pred"><paramtype>Pred</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes all the elements for which a specified predicate is satisfied. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  2084. <method name="unique"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that are equal from the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1 comparisons calls to pred()).</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  2085. <method name="unique"><type>void</type><template>
  2086. <template-type-parameter name="BinaryPredicate"/>
  2087. </template><parameter name="pred"><paramtype>BinaryPredicate</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1 comparisons equality comparisons).</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  2088. <method name="unique_and_dispose"><type>void</type><template>
  2089. <template-type-parameter name="Disposer"/>
  2090. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that are equal from the list. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  2091. <method name="unique_and_dispose"><type>void</type><template>
  2092. <template-type-parameter name="BinaryPredicate"/>
  2093. <template-type-parameter name="Disposer"/>
  2094. </template><parameter name="pred"><paramtype>BinaryPredicate</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  2095. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns a const_iterator pointing to the element</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
  2096. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a const reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns an iterator pointing to the element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
  2097. <method name="check" cv="const"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
  2098. </method-group>
  2099. <constructor><description><para><emphasis role="bold">Effects</emphasis>: constructs an empty list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
  2100. <constructor specifiers="explicit"><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: constructs an empty list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
  2101. <constructor><template>
  2102. <template-type-parameter name="Iterator"/>
  2103. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs a list equal to the range [first,last).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in distance(b, e). No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
  2104. <constructor><parameter name="x"><paramtype><classname>list</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of value traits throws. </para></description></constructor>
  2105. <copy-assignment><type><classname>list</classname> &amp;</type><parameter name="x"><paramtype><classname>list</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  2106. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If it's not a safe-mode or an auto-unlink value_type the destructor does nothing (ie. no code is generated). Otherwise it detaches all elements from this. In this case the objects in the list are not deleted (i.e. no destructors are called), but the hooks according to the ValueTraits template parameter are set to their default value.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the list, if it's a safe-mode or auto-unlink value . Otherwise constant. </para></description></destructor>
  2107. <method-group name="public static functions">
  2108. <method name="container_from_end_iterator" specifiers="static"><type><classname>list</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of list.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the list associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2109. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>list</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end const_iterator of list.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the list associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2110. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns a const_iterator pointing to the element</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  2111. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a const reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns an iterator pointing to the element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  2112. </method-group>
  2113. </class><struct name="make_list"><template>
  2114. <template-type-parameter name="T"/>
  2115. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2116. </template><description><para>Helper metafunction to define a <computeroutput>list</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  2117. </struct>
  2118. </namespace>
  2119. </namespace>
  2120. </header>
  2121. <header name="boost/intrusive/list_hook.hpp">
  2122. <namespace name="boost">
  2123. <namespace name="intrusive">
  2124. <class name="list_base_hook"><template>
  2125. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2126. </template><inherit access="public">make_list_base_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Derive a class from this hook in order to store objects of that class in an list.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
  2127. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>list_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2128. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>list::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  2129. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2130. </method-group>
  2131. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  2132. <constructor><parameter name=""><paramtype>const <classname>list_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  2133. <copy-assignment><type><classname>list_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>list_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  2134. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an list an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  2135. </class><class name="list_member_hook"><template>
  2136. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2137. </template><inherit access="public">make_list_member_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Store this hook in a class to be inserted in an list.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
  2138. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>list_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2139. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>list::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  2140. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2141. </method-group>
  2142. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  2143. <constructor><parameter name=""><paramtype>const <classname>list_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  2144. <copy-assignment><type><classname>list_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>list_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  2145. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an list an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  2146. </class><struct name="make_list_base_hook"><template>
  2147. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2148. </template><description><para>Helper metafunction to define a <computeroutput><computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> that</computeroutput> yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  2149. </struct><struct name="make_list_member_hook"><template>
  2150. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2151. </template><description><para>Helper metafunction to define a <computeroutput><computeroutput><classname alt="boost::intrusive::list_member_hook">list_member_hook</classname></computeroutput> that</computeroutput> yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  2152. </struct>
  2153. </namespace>
  2154. </namespace>
  2155. </header>
  2156. <header name="boost/intrusive/member_value_traits.hpp">
  2157. <namespace name="boost">
  2158. <namespace name="intrusive">
  2159. <struct name="member_value_traits"><template>
  2160. <template-type-parameter name="T"/>
  2161. <template-type-parameter name="NodeTraits"/>
  2162. <template-nontype-parameter name="PtrToMember"><type>typename NodeTraits::node T::*</type></template-nontype-parameter>
  2163. <template-nontype-parameter name="LinkMode"><type>link_mode_type</type><default>safe_link</default></template-nontype-parameter>
  2164. </template><description><para>This value traits template is used to create value traits from user defined node traits where value_traits::value_type will store a node_traits::node </para></description><typedef name="node_traits"><type>NodeTraits</type></typedef>
  2165. <typedef name="value_type"><type>T</type></typedef>
  2166. <typedef name="node"><type>node_traits::node</type></typedef>
  2167. <typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
  2168. <typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
  2169. <typedef name="node_ptr_traits"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;</type></typedef>
  2170. <typedef name="pointer"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::template rebind_pointer&lt; T &gt;::type</type></typedef>
  2171. <typedef name="const_pointer"><type><classname>pointer_traits</classname>&lt; node_ptr &gt;::template rebind_pointer&lt; const T &gt;::type</type></typedef>
  2172. <typedef name="reference"><type>value_type &amp;</type></typedef>
  2173. <typedef name="const_reference"><type>const value_type &amp;</type></typedef>
  2174. <data-member name="link_mode" specifiers="static"><type>const link_mode_type</type></data-member>
  2175. <method-group name="public static functions">
  2176. <method name="to_node_ptr" specifiers="static"><type>node_ptr</type><parameter name="value"><paramtype>reference</paramtype></parameter></method>
  2177. <method name="to_node_ptr" specifiers="static"><type>const_node_ptr</type><parameter name="value"><paramtype>const_reference</paramtype></parameter></method>
  2178. <method name="to_value_ptr" specifiers="static"><type>pointer</type><parameter name="n"><paramtype>const node_ptr &amp;</paramtype></parameter></method>
  2179. <method name="to_value_ptr" specifiers="static"><type>const_pointer</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter></method>
  2180. </method-group>
  2181. </struct>
  2182. </namespace>
  2183. </namespace>
  2184. </header>
  2185. <header name="boost/intrusive/options.hpp">
  2186. <namespace name="boost">
  2187. <namespace name="intrusive">
  2188. <struct name="base_hook"><template>
  2189. <template-type-parameter name="BaseHook"/>
  2190. </template><description><para>This option setter specifies that the container must use the specified base hook </para></description></struct><struct name="bucket_traits"><template>
  2191. <template-type-parameter name="BucketTraits"/>
  2192. </template><description><para>This option setter specifies the bucket traits class for unordered associative containers. When this option is specified, instead of using the default bucket traits, a user defined holder will be defined </para></description></struct><struct name="cache_begin"><template>
  2193. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2194. </template><description><para>This option setter specifies if the container will cache a pointer to the first non-empty bucket so that begin() is always constant-time. This is specially helpful when we can have containers with a few elements but with big bucket arrays (that is, hashtables with low load factors). </para></description></struct><struct name="cache_last"><template>
  2195. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2196. </template><description><para>If true, slist also stores a pointer to the last element of the singly linked list. This allows O(1) swap and splice_after(iterator, slist &amp;) for circular slists and makes possible new functions like push_back(reference) and back(). </para></description></struct><struct name="compare"><template>
  2197. <template-type-parameter name="Compare"/>
  2198. </template><description><para>This option setter specifies the strict weak ordering comparison functor for the value type </para></description></struct><struct name="compare_hash"><template>
  2199. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2200. </template><description><para>This option setter specifies if the container will compare the hash value before comparing objects. This option can't be specified if store_hash&lt;&gt; is not true. This is specially helpful when we have containers with a high load factor. and the comparison function is much more expensive that comparing already stored hash values. </para></description></struct><struct name="constant_time_size"><template>
  2201. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2202. </template><description><para>This option setter specifies if the intrusive container stores its size as a member to obtain constant-time size() member. </para></description></struct><struct name="equal"><template>
  2203. <template-type-parameter name="Equal"/>
  2204. </template><description><para>This option setter specifies the equality functor for the value type </para></description></struct><struct name="floating_point"><template>
  2205. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2206. </template><description><para>This option setter for scapegoat containers specifies if the intrusive scapegoat container should use a non-variable alpha value that does not need floating-point operations.</para><para>If activated, the fixed alpha value is 1/sqrt(2). This option also saves some space in the container since the alpha value and some additional data does not need to be stored in the container.</para><para>If the user only needs an alpha value near 1/sqrt(2), this option also improves performance since avoids logarithm and division operations when rebalancing the tree. </para></description></struct><struct name="function_hook"><template>
  2207. <template-type-parameter name="Functor"/>
  2208. </template><description><para>This option setter specifies the function object that will be used to convert between values to be inserted in a container and the hook to be used for that purpose. </para></description></struct><struct name="hash"><template>
  2209. <template-type-parameter name="Hash"/>
  2210. </template><description><para>This option setter specifies the hash functor for the value type </para></description></struct><struct name="header_holder_type"><template>
  2211. <template-type-parameter name="HeaderHolder"/>
  2212. </template><purpose>This option setter specifies a container header holder type. </purpose></struct><struct name="incremental"><template>
  2213. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2214. </template><description><para>This option setter specifies if the hash container will use incremental hashing. With incremental hashing the cost of hash table expansion is spread out across each hash table insertion operation, as opposed to be incurred all at once. Therefore linear hashing is well suited for interactive applications or real-time appplications where the worst-case insertion time of non-incremental hash containers (rehashing the whole bucket array) is not admisible. </para></description></struct><struct name="key_of_value"><template>
  2215. <template-type-parameter name="KeyOfValue"/>
  2216. </template><description><para>This option setter specifies a function object that specifies the type of the key of an associative container and an operator to obtain it from a value type.</para><para>This function object must the define a <computeroutput>type</computeroutput> member typedef and a member with signature <computeroutput>type [const&amp;] operator()(const value_type &amp;) const</computeroutput> that will return the key from a value_type of an associative container </para></description></struct><struct name="linear"><template>
  2217. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2218. </template><description><para>This option setter specifies if the slist container should use a linear implementation instead of a circular one. </para></description></struct><struct name="link_mode"><template>
  2219. <template-nontype-parameter name="LinkType"><type>link_mode_type</type></template-nontype-parameter>
  2220. </template><description><para>This option setter specifies the link mode (normal_link, safe_link or auto_unlink) </para></description></struct><struct name="member_hook"><template>
  2221. <template-type-parameter name="Parent"/>
  2222. <template-type-parameter name="MemberHook"/>
  2223. <template-nontype-parameter name="PtrToMember"><type>MemberHook Parent::*</type></template-nontype-parameter>
  2224. </template><description><para>This option setter specifies the member hook the container must use. </para></description></struct><struct name="optimize_multikey"><template>
  2225. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2226. </template><description><para>This option setter specifies if the unordered hook should offer room to store another link to another node with the same key. Storing this link will speed up lookups and insertions on <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> containers with a great number of elements with the same key. </para></description></struct><struct name="optimize_size"><template>
  2227. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2228. </template><description><para>This option setter specifies if the hook should be optimized for size instead of for speed. </para></description></struct><struct name="power_2_buckets"><template>
  2229. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2230. </template><description><para>This option setter specifies if the bucket array will be always power of two. This allows using masks instead of the default modulo operation to determine the bucket number from the hash value, leading to better performance. In debug mode, if power of two buckets mode is activated, the bucket length will be checked with assertions. </para></description></struct><struct name="priority"><template>
  2231. <template-type-parameter name="Priority"/>
  2232. </template><description><para>This option setter specifies the priority comparison functor for the value type </para></description></struct><struct name="priority_of_value"><template>
  2233. <template-type-parameter name="PrioOfValue"/>
  2234. </template><description><para>This option setter specifies a function object that specifies the type of the priority of a treap container and an operator to obtain it from a value type.</para><para>This function object must the define a <computeroutput>type</computeroutput> member typedef and a member with signature <computeroutput>type [const&amp;] operator()(const value_type &amp;) const</computeroutput> that will return the priority from a value_type of a treap container </para></description></struct><struct name="size_type"><template>
  2235. <template-type-parameter name="SizeType"/>
  2236. </template><description><para>This option setter specifies the type that the container will use to store its size. </para></description></struct><struct name="store_hash"><template>
  2237. <template-nontype-parameter name="Enabled"><type>bool</type></template-nontype-parameter>
  2238. </template><description><para>This option setter specifies if the unordered hook should offer room to store the hash value. Storing the hash in the hook will speed up rehashing processes in applications where rehashing is frequent, rehashing might throw or the value is heavy to hash. </para></description></struct><struct name="tag"><template>
  2239. <template-type-parameter name="Tag"/>
  2240. </template><description><para>This option setter specifies the type of the tag of a base hook. A type cannot have two base hooks of the same type, so a tag can be used to differentiate two base hooks with otherwise same type </para></description></struct><struct name="value_traits"><template>
  2241. <template-type-parameter name="ValueTraits"/>
  2242. </template><description><para>This option setter specifies the relationship between the type to be managed by the container (the value type) and the node to be used in the node algorithms. It also specifies the linking policy. </para></description></struct><struct name="void_pointer"><template>
  2243. <template-type-parameter name="VoidPointer"/>
  2244. </template><description><para>This option setter specifies the type of a void pointer. This will instruct the hook to use this type of pointer instead of the default one </para></description></struct>
  2245. </namespace>
  2246. </namespace>
  2247. </header>
  2248. <header name="boost/intrusive/pack_options.hpp">
  2249. <namespace name="boost">
  2250. <namespace name="intrusive">
  2251. <struct name="pack_options"><template>
  2252. <template-type-parameter name="DefaultOptions"/>
  2253. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2254. </template><description><para>This class is a utility that takes:<itemizedlist>
  2255. <listitem><para>a default options class defining initial static constant and typedefs</para>
  2256. </listitem><listitem><para>several options defined with BOOST_INTRUSIVE_OPTION_CONSTANT and BOOST_INTRUSIVE_OPTION_TYPE</para>
  2257. </listitem></itemizedlist>
  2258. </para><para>and packs them together in a new type that defines all options as member typedefs or static constant values. Given options of form:</para><para><programlisting language="c++">BOOST_INTRUSIVE_OPTION_TYPE(my_pointer, VoidPointer, VoidPointer, my_pointer_type)
  2259. BOOST_INTRUSIVE_OPTION_CONSTANT(incremental, bool, Enabled, is_incremental)
  2260. </programlisting></para><para>the following expression</para><para><programlisting language="c++">struct default_options
  2261. {
  2262. typedef long int_type;
  2263. static const int int_constant = -1;
  2264. };
  2265. pack_options&lt; default_options, my_pointer&lt;void*&gt;, incremental&lt;true&gt; &gt;::type
  2266. </programlisting></para><para>will create a type that will contain the following typedefs/constants</para><para><programlisting language="c++">struct unspecified_type
  2267. {
  2268. //Default options
  2269. typedef long int_type;
  2270. static const int int_constant = -1;
  2271. //Packed options (will ovewrite any default option)
  2272. typedef void* my_pointer_type;
  2273. static const bool is_incremental = true;
  2274. };
  2275. </programlisting></para><para>If an option is specified in the default options argument and later redefined as an option, the last definition will prevail. </para></description><typedef name="type"><type>unspecified_type</type></typedef>
  2276. </struct>
  2277. </namespace>
  2278. </namespace>
  2279. <macro name="BOOST_INTRUSIVE_OPTION_TYPE" kind="functionlike"><macro-parameter name="OPTION_NAME"/><macro-parameter name="TYPE"/><macro-parameter name="TYPEDEF_EXPR"/><macro-parameter name="TYPEDEF_NAME"/><description><para>Defines an option class of name OPTION_NAME that can be used to specify a type of type TYPE...</para><para><programlisting language="c++">struct OPTION_NAME&lt;class TYPE&gt;
  2280. { unspecified_content };
  2281. </programlisting></para><para>...that after being combined with <computeroutput><classname alt="boost::intrusive::pack_options">boost::intrusive::pack_options</classname></computeroutput>, will typedef TYPE as a typedef of name TYPEDEF_NAME. Example:</para><para><programlisting language="c++">//[includes and namespaces omitted for brevity]
  2282. //This macro will create the following class:
  2283. // template&lt;class VoidPointer&gt;
  2284. // struct my_pointer
  2285. // { unspecified_content };
  2286. BOOST_INTRUSIVE_OPTION_TYPE(my_pointer, VoidPointer, boost::remove_pointer&lt;VoidPointer&gt;::type, my_pointer_type)
  2287. struct empty_default{};
  2288. typedef pack_options&lt; empty_default, typename my_pointer&lt;void*&gt; &gt;::type::my_pointer_type type;
  2289. BOOST_STATIC_ASSERT(( boost::is_same&lt;type, void&gt;::value ));
  2290. </programlisting> </para></description></macro>
  2291. <macro name="BOOST_INTRUSIVE_OPTION_CONSTANT" kind="functionlike"><macro-parameter name="OPTION_NAME"/><macro-parameter name="TYPE"/><macro-parameter name="VALUE"/><macro-parameter name="CONSTANT_NAME"/><description><para>Defines an option class of name OPTION_NAME that can be used to specify a constant of type TYPE with value VALUE...</para><para><programlisting language="c++">struct OPTION_NAME&lt;TYPE VALUE&gt;
  2292. { unspecified_content };
  2293. </programlisting></para><para>...that after being combined with <computeroutput><classname alt="boost::intrusive::pack_options">boost::intrusive::pack_options</classname></computeroutput>, will contain a CONSTANT_NAME static constant of value VALUE. Example:</para><para><programlisting language="c++">//[includes and namespaces omitted for brevity]
  2294. //This macro will create the following class:
  2295. // template&lt;bool Enabled&gt;
  2296. // struct incremental
  2297. // { unspecified_content };
  2298. BOOST_INTRUSIVE_OPTION_CONSTANT(incremental, bool, Enabled, is_incremental)
  2299. struct empty_default{};
  2300. const bool is_incremental = pack_options&lt; empty_default, incremental&lt;true&gt; &gt;::type::is_incremental;
  2301. BOOST_STATIC_ASSERT(( is_incremental == true ));
  2302. </programlisting> </para></description></macro>
  2303. </header>
  2304. <header name="boost/intrusive/parent_from_member.hpp">
  2305. <namespace name="boost">
  2306. <namespace name="intrusive">
  2307. <function name="get_parent_from_member"><type>Parent *</type><template>
  2308. <template-type-parameter name="Parent"/>
  2309. <template-type-parameter name="Member"/>
  2310. </template><parameter name="member"><paramtype>Member *</paramtype></parameter><parameter name="ptr_to_member"><paramtype>const Member Parent::*</paramtype></parameter><description><para>Given a pointer to a member and its corresponding pointer to data member, this function returns the pointer of the parent containing that member. Note: this function does not work with pointer to members that rely on virtual inheritance. </para></description></function>
  2311. <function name="get_parent_from_member"><type>const Parent *</type><template>
  2312. <template-type-parameter name="Parent"/>
  2313. <template-type-parameter name="Member"/>
  2314. </template><parameter name="member"><paramtype>const Member *</paramtype></parameter><parameter name="ptr_to_member"><paramtype>const Member Parent::*</paramtype></parameter><description><para>Given a const pointer to a member and its corresponding const pointer to data member, this function returns the const pointer of the parent containing that member. Note: this function does not work with pointer to members that rely on virtual inheritance. </para></description></function>
  2315. </namespace>
  2316. </namespace>
  2317. </header>
  2318. <header name="boost/intrusive/pointer_plus_bits.hpp">
  2319. <namespace name="boost">
  2320. <namespace name="intrusive">
  2321. <struct name="max_pointer_plus_bits"><template>
  2322. <template-type-parameter name="VoidPointer"/>
  2323. <template-nontype-parameter name="Alignment"><type>std::size_t</type></template-nontype-parameter>
  2324. </template><description><para>This trait class is used to know if a pointer can embed extra bits of information if it's going to be used to point to objects with an alignment of "Alignment" bytes. </para></description><data-member name="value" specifiers="static"><type>const std::size_t</type></data-member>
  2325. </struct><struct-specialization name="max_pointer_plus_bits"><template>
  2326. <template-nontype-parameter name="Alignment"><type>std::size_t</type></template-nontype-parameter>
  2327. </template><specialization><template-arg>void *</template-arg><template-arg>Alignment</template-arg></specialization><description><para>This is a specialization for raw pointers. Raw pointers can embed extra bits in the lower bits if the alignment is multiple of 2pow(NumBits). </para></description><data-member name="value" specifiers="static"><type>const std::size_t</type></data-member>
  2328. </struct-specialization><struct name="pointer_plus_bits"><template>
  2329. <template-type-parameter name="Pointer"/>
  2330. <template-nontype-parameter name="NumBits"><type>std::size_t</type></template-nontype-parameter>
  2331. </template><description><para>This is class that is supposed to have static methods to embed extra bits of information in a pointer. This is a declaration and there is no default implementation, because operations to embed the bits change with every pointer type.</para><para>An implementation that detects that a pointer type whose has_pointer_plus_bits&lt;&gt;::value is non-zero can make use of these operations to embed the bits in the pointer. </para></description></struct><struct-specialization name="pointer_plus_bits"><template>
  2332. <template-type-parameter name="T"/>
  2333. <template-nontype-parameter name="NumBits"><type>std::size_t</type></template-nontype-parameter>
  2334. </template><specialization><template-arg>T *</template-arg><template-arg>NumBits</template-arg></specialization><description><para>This is the specialization to embed extra bits of information in a raw pointer. The extra bits are stored in the lower bits of the pointer. </para></description><typedef name="pointer"><type>T *</type></typedef>
  2335. <data-member name="Mask" specifiers="static"><type>const uintptr_t</type></data-member>
  2336. <method-group name="public static functions">
  2337. <method name="get_pointer" specifiers="static"><type>pointer</type><parameter name="n"><paramtype>pointer</paramtype></parameter></method>
  2338. <method name="set_pointer" specifiers="static"><type>void</type><parameter name="n"><paramtype>pointer &amp;</paramtype></parameter><parameter name="p"><paramtype>pointer</paramtype></parameter></method>
  2339. <method name="get_bits" specifiers="static"><type>std::size_t</type><parameter name="n"><paramtype>pointer</paramtype></parameter></method>
  2340. <method name="set_bits" specifiers="static"><type>void</type><parameter name="n"><paramtype>pointer &amp;</paramtype></parameter><parameter name="c"><paramtype>std::size_t</paramtype></parameter></method>
  2341. </method-group>
  2342. </struct-specialization>
  2343. </namespace>
  2344. </namespace>
  2345. </header>
  2346. <header name="boost/intrusive/pointer_rebind.hpp">
  2347. <namespace name="boost">
  2348. <namespace name="intrusive">
  2349. <struct name="pointer_has_rebind"><template>
  2350. <template-type-parameter name="Ptr"/>
  2351. <template-type-parameter name="U"/>
  2352. </template><struct name="any"><template>
  2353. <template-type-parameter name="V"/>
  2354. </template><method-group name="public member functions">
  2355. </method-group>
  2356. <constructor><parameter name=""><paramtype>const V &amp;</paramtype></parameter></constructor>
  2357. </struct><data-member name="value" specifiers="static"><type>const bool</type></data-member>
  2358. <method-group name="public static functions">
  2359. <method name="test" specifiers="static"><type>char</type><template>
  2360. <template-type-parameter name="X"/>
  2361. </template><parameter name=""><paramtype>int</paramtype></parameter><parameter name=""><paramtype>typename X::template rebind&lt; U &gt; *</paramtype></parameter></method>
  2362. <method name="test" specifiers="static"><type>int</type><template>
  2363. <template-type-parameter name="X"/>
  2364. </template><parameter name=""><paramtype>any&lt; int &gt;</paramtype></parameter><parameter name=""><paramtype>void *</paramtype></parameter></method>
  2365. </method-group>
  2366. </struct><struct name="pointer_has_rebind_other"><template>
  2367. <template-type-parameter name="Ptr"/>
  2368. <template-type-parameter name="U"/>
  2369. </template><struct name="any"><template>
  2370. <template-type-parameter name="V"/>
  2371. </template><method-group name="public member functions">
  2372. </method-group>
  2373. <constructor><parameter name=""><paramtype>const V &amp;</paramtype></parameter></constructor>
  2374. </struct><data-member name="value" specifiers="static"><type>const bool</type></data-member>
  2375. <method-group name="public static functions">
  2376. <method name="test" specifiers="static"><type>char</type><template>
  2377. <template-type-parameter name="X"/>
  2378. </template><parameter name=""><paramtype>int</paramtype></parameter><parameter name=""><paramtype>typename X::template rebind&lt; U &gt;::other *</paramtype></parameter></method>
  2379. <method name="test" specifiers="static"><type>int</type><template>
  2380. <template-type-parameter name="X"/>
  2381. </template><parameter name=""><paramtype>any&lt; int &gt;</paramtype></parameter><parameter name=""><paramtype>void *</paramtype></parameter></method>
  2382. </method-group>
  2383. </struct><struct name="pointer_rebind"><template>
  2384. <template-type-parameter name="Ptr"/>
  2385. <template-type-parameter name="U"/>
  2386. </template><inherit access="public">boost::intrusive::pointer_rebinder&lt; Ptr, U, pointer_rebind_mode&lt; Ptr, U &gt;::mode &gt;</inherit><purpose>defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) </purpose></struct><struct-specialization name="pointer_rebind"><template>
  2387. <template-type-parameter name="T"/>
  2388. <template-type-parameter name="U"/>
  2389. </template><specialization><template-arg>T *</template-arg><template-arg>U</template-arg></specialization><typedef name="type"><type>U *</type></typedef>
  2390. </struct-specialization><struct name="pointer_rebind_mode"><template>
  2391. <template-type-parameter name="Ptr"/>
  2392. <template-type-parameter name="U"/>
  2393. </template><data-member name="rebind" specifiers="static"><type>const unsigned int</type></data-member>
  2394. <data-member name="rebind_other" specifiers="static"><type>const unsigned int</type></data-member>
  2395. <data-member name="mode" specifiers="static"><type>const unsigned int</type></data-member>
  2396. </struct><struct name="pointer_rebinder"><template>
  2397. <template-type-parameter name="Ptr"/>
  2398. <template-type-parameter name="U"/>
  2399. <template-nontype-parameter name="RebindMode"><type>unsigned int</type></template-nontype-parameter>
  2400. </template></struct><struct-specialization name="pointer_rebinder"><template>
  2401. <template-type-parameter name="Ptr"/>
  2402. <template-type-parameter name="U"/>
  2403. </template><specialization><template-arg>Ptr</template-arg><template-arg>U</template-arg><template-arg>1u</template-arg></specialization><typedef name="type"><type>Ptr::template rebind&lt; U &gt;</type></typedef>
  2404. </struct-specialization><struct-specialization name="pointer_rebinder"><template>
  2405. <template-type-parameter name="Ptr"/>
  2406. <template-type-parameter name="U"/>
  2407. </template><specialization><template-arg>Ptr</template-arg><template-arg>U</template-arg><template-arg>2u</template-arg></specialization><typedef name="type"><type>Ptr::template rebind&lt; U &gt;::other</type></typedef>
  2408. </struct-specialization><struct-specialization name="pointer_rebinder"><template>
  2409. <template-nontype-parameter name="Ptr"><type>template&lt; class &gt; class</type></template-nontype-parameter>
  2410. <template-type-parameter name="A"/>
  2411. <template-type-parameter name="U"/>
  2412. </template><specialization><template-arg>Ptr&lt; A &gt;</template-arg><template-arg>U</template-arg><template-arg>0u</template-arg></specialization><typedef name="type"><type>Ptr&lt; U &gt;</type></typedef>
  2413. </struct-specialization><struct-specialization name="pointer_rebinder"><template>
  2414. <template-nontype-parameter name="Ptr"><type>template&lt; class, class... &gt; class</type></template-nontype-parameter>
  2415. <template-type-parameter name="A"/>
  2416. <template-nontype-parameter name="An"><type>class...</type></template-nontype-parameter>
  2417. <template-type-parameter name="U"/>
  2418. </template><specialization><template-arg>Ptr&lt; A</template-arg><template-arg>An... &gt;</template-arg><template-arg>U</template-arg><template-arg>0u</template-arg></specialization><typedef name="type"><type>Ptr&lt; U, An... &gt;</type></typedef>
  2419. </struct-specialization>
  2420. </namespace>
  2421. </namespace>
  2422. </header>
  2423. <header name="boost/intrusive/pointer_traits.hpp">
  2424. <namespace name="boost">
  2425. <namespace name="intrusive">
  2426. <struct name="pointer_traits"><template>
  2427. <template-type-parameter name="Ptr"/>
  2428. </template><description><para><classname alt="boost::intrusive::pointer_traits">pointer_traits</classname> is the implementation of C++11 std::pointer_traits class with some extensions like castings.</para><para><classname alt="boost::intrusive::pointer_traits">pointer_traits</classname> supplies a uniform interface to certain attributes of pointer-like types.</para><para><emphasis role="bold">Note</emphasis>: When defining a custom family of pointers or references to be used with BI library, make sure the public static conversion functions accessed through the <computeroutput><classname alt="boost::intrusive::pointer_traits">pointer_traits</classname></computeroutput> interface (<computeroutput>*_cast_from</computeroutput> and <computeroutput>pointer_to</computeroutput>) can properly convert between const and nonconst referred member types <emphasis role="bold">without the use of implicit constructor calls</emphasis>. It is suggested these conversions be implemented as function templates, where the template argument is the type of the object being converted from. </para></description><typedef name="pointer"><description><para>The pointer type queried by this <classname alt="boost::intrusive::pointer_traits">pointer_traits</classname> instantiation </para></description><type>Ptr</type></typedef>
  2429. <typedef name="element_type"><description><para>Ptr::element_type if such a type exists; otherwise, T if Ptr is a class template instantiation of the form SomePointer&lt;T, Args&gt;, where Args is zero or more type arguments ; otherwise , the specialization is ill-formed. </para></description><type>unspecified_type</type></typedef>
  2430. <typedef name="difference_type"><description><para>Ptr::difference_type if such a type exists; otherwise, std::ptrdiff_t. </para></description><type>unspecified_type</type></typedef>
  2431. <typedef name="rebind"><description><para>Ptr::rebind&lt;U&gt; if such a type exists; otherwise, SomePointer&lt;U, Args&gt; if Ptr is a class template instantiation of the form SomePointer&lt;T, Args&gt;, where Args is zero or more type arguments ; otherwise, the instantiation of rebind is ill-formed.</para><para>For portable code for C++03 and C++11, <programlisting>typename rebind_pointer&lt;U&gt;::type</programlisting> shall be used instead of rebind<underline> to obtain a pointer to U. </underline></para></description><type>unspecified</type></typedef>
  2432. <typedef name="reference"><description><para>Ptr::reference if such a type exists (non-standard extension); otherwise, element_type &amp; </para></description><type>unspecified_type</type></typedef>
  2433. <method-group name="public static functions">
  2434. <method name="pointer_to" specifiers="static"><type>pointer</type><parameter name="r"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Remark</emphasis>: If element_type is (possibly cv-qualified) void, r type is unspecified; otherwise, it is element_type &amp;.</para><para><emphasis role="bold">Returns</emphasis>: A dereferenceable pointer to r obtained by calling Ptr::pointer_to(reference). Non-standard extension: If such function does not exist, returns pointer(addressof(r));</para><para><emphasis role="bold">Note</emphasis>: For non-conforming compilers only the existence of a member function called <computeroutput>pointer_to</computeroutput> is checked. </para></description></method>
  2435. <method name="static_cast_from" specifiers="static"><type>pointer</type><template>
  2436. <template-type-parameter name="UPtr"/>
  2437. </template><parameter name="uptr"><paramtype>const UPtr &amp;</paramtype></parameter><description><para><emphasis role="bold">Remark</emphasis>: Non-standard extension.</para><para><emphasis role="bold">Returns</emphasis>: A dereferenceable pointer to r obtained by calling the static template function Ptr::static_cast_from(UPpr/const UPpr &amp;). If such function does not exist, returns pointer_to(static_cast&lt;element_type&amp;&gt;(*uptr))</para><para><emphasis role="bold">Note</emphasis>: For non-conforming compilers only the existence of a member function called <computeroutput>static_cast_from</computeroutput> is checked. </para></description></method>
  2438. <method name="const_cast_from" specifiers="static"><type>pointer</type><template>
  2439. <template-type-parameter name="UPtr"/>
  2440. </template><parameter name="uptr"><paramtype>const UPtr &amp;</paramtype></parameter><description><para><emphasis role="bold">Remark</emphasis>: Non-standard extension.</para><para><emphasis role="bold">Returns</emphasis>: A dereferenceable pointer to r obtained by calling the static template function Ptr::const_cast_from&lt;UPtr&gt;(UPpr/const UPpr &amp;). If such function does not exist, returns pointer_to(const_cast&lt;element_type&amp;&gt;(*uptr))</para><para><emphasis role="bold">Note</emphasis>: For non-conforming compilers only the existence of a member function called <computeroutput>const_cast_from</computeroutput> is checked. </para></description></method>
  2441. <method name="dynamic_cast_from" specifiers="static"><type>pointer</type><template>
  2442. <template-type-parameter name="UPtr"/>
  2443. </template><parameter name="uptr"><paramtype>const UPtr &amp;</paramtype></parameter><description><para><emphasis role="bold">Remark</emphasis>: Non-standard extension.</para><para><emphasis role="bold">Returns</emphasis>: A dereferenceable pointer to r obtained by calling the static template function Ptr::dynamic_cast_from&lt;UPtr&gt;(UPpr/const UPpr &amp;). If such function does not exist, returns pointer_to(<emphasis>dynamic_cast&lt;element_type</emphasis>&gt;(&amp;*uptr))</para><para><emphasis role="bold">Note</emphasis>: For non-conforming compilers only the existence of a member function called <computeroutput>dynamic_cast_from</computeroutput> is checked. </para></description></method>
  2444. </method-group>
  2445. </struct><struct-specialization name="pointer_traits"><template>
  2446. <template-type-parameter name="T"/>
  2447. </template><specialization><template-arg>T *</template-arg></specialization><description><para>Specialization of <classname alt="boost::intrusive::pointer_traits">pointer_traits</classname> for raw pointers </para></description><struct name="rebind_pointer"><template>
  2448. <template-type-parameter name="U"/>
  2449. </template><typedef name="type"><type>U *</type></typedef>
  2450. </struct><typedef name="element_type"><type>T</type></typedef>
  2451. <typedef name="pointer"><type>T *</type></typedef>
  2452. <typedef name="difference_type"><type>std::ptrdiff_t</type></typedef>
  2453. <typedef name="reference"><type>T &amp;</type></typedef>
  2454. <typedef name="rebind"><description><programlisting>U *</programlisting><para>For portable code for C++03 and C++11, <programlisting>typename rebind_pointer&lt;U&gt;::type</programlisting> shall be used instead of rebind<underline> to obtain a pointer to U. </underline></para></description><type>U *</type></typedef>
  2455. <method-group name="public static functions">
  2456. <method name="pointer_to" specifiers="static"><type>pointer</type><parameter name="r"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: addressof(r) </para></description></method>
  2457. <method name="static_cast_from" specifiers="static"><type>pointer</type><template>
  2458. <template-type-parameter name="U"/>
  2459. </template><parameter name="uptr"><paramtype>U *</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: static_cast&lt;pointer&gt;(uptr) </para></description></method>
  2460. <method name="const_cast_from" specifiers="static"><type>pointer</type><template>
  2461. <template-type-parameter name="U"/>
  2462. </template><parameter name="uptr"><paramtype>U *</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: const_cast&lt;pointer&gt;(uptr) </para></description></method>
  2463. <method name="dynamic_cast_from" specifiers="static"><type>pointer</type><template>
  2464. <template-type-parameter name="U"/>
  2465. </template><parameter name="uptr"><paramtype>U *</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: dynamic_cast&lt;pointer&gt;(uptr) </para></description></method>
  2466. </method-group>
  2467. </struct-specialization>
  2468. </namespace>
  2469. </namespace>
  2470. </header>
  2471. <header name="boost/intrusive/priority_compare.hpp">
  2472. <namespace name="boost">
  2473. <namespace name="intrusive">
  2474. <struct name="priority_compare"><template>
  2475. <template-type-parameter name="T"><default>void</default></template-type-parameter>
  2476. </template><typedef name="first_argument_type"><type>T</type></typedef>
  2477. <typedef name="second_argument_type"><type>T</type></typedef>
  2478. <typedef name="result_type"><type>bool</type></typedef>
  2479. <method-group name="public member functions">
  2480. <method name="operator()" cv="const"><type>bool</type><parameter name="val"><paramtype>const T &amp;</paramtype></parameter><parameter name="val2"><paramtype>const T &amp;</paramtype></parameter></method>
  2481. </method-group>
  2482. </struct><struct-specialization name="priority_compare"><template>
  2483. </template><specialization><template-arg>void</template-arg></specialization><method-group name="public member functions">
  2484. <method name="operator()" cv="const"><type>bool</type><template>
  2485. <template-type-parameter name="T"/>
  2486. <template-type-parameter name="U"/>
  2487. </template><parameter name="t"><paramtype>const T &amp;</paramtype></parameter><parameter name="u"><paramtype>const U &amp;</paramtype></parameter></method>
  2488. </method-group>
  2489. </struct-specialization>
  2490. </namespace>
  2491. </namespace>
  2492. </header>
  2493. <header name="boost/intrusive/rbtree.hpp">
  2494. <namespace name="boost">
  2495. <namespace name="intrusive">
  2496. <struct name="make_rbtree"><template>
  2497. <template-type-parameter name="T"/>
  2498. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2499. </template><description><para>Helper metafunction to define a <computeroutput>rbtree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  2500. </struct><class name="rbtree"><template>
  2501. <template-type-parameter name="T"/>
  2502. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2503. </template><description><para>The class template rbtree is an intrusive red-black tree container, that is used to construct intrusive set and multiset containers. The no-throw guarantee holds only, if the key_compare object doesn't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
  2504. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  2505. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  2506. <typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  2507. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  2508. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  2509. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  2510. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  2511. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  2512. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  2513. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  2514. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  2515. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  2516. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  2517. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  2518. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  2519. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  2520. <typedef name="node"><type>implementation_defined::node</type></typedef>
  2521. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  2522. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  2523. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  2524. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  2525. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  2526. <method-group name="public member functions">
  2527. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2528. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2529. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2530. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2531. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2532. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2533. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2534. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2535. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2536. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2537. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2538. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2539. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2540. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2541. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2542. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  2543. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  2544. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2545. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2546. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>rbtree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  2547. <method name="clone_from"><type>void</type><template>
  2548. <template-type-parameter name="Cloner"/>
  2549. <template-type-parameter name="Disposer"/>
  2550. </template><parameter name="src"><paramtype>const <classname>rbtree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  2551. <method name="clone_from"><type>void</type><template>
  2552. <template-type-parameter name="Cloner"/>
  2553. <template-type-parameter name="Disposer"/>
  2554. </template><parameter name="src"><paramtype><classname>rbtree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  2555. <method name="clone_from"><type>void</type><template>
  2556. <template-type-parameter name="Cloner"/>
  2557. <template-type-parameter name="Disposer"/>
  2558. </template><parameter name="src"><paramtype><classname>rbtree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  2559. <method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  2560. <method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  2561. <method name="insert_equal"><type>void</type><template>
  2562. <template-type-parameter name="Iterator"/>
  2563. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  2564. <method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  2565. <method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  2566. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  2567. <template-type-parameter name="KeyType"/>
  2568. <template-type-parameter name="KeyTypeKeyCompare"/>
  2569. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  2570. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  2571. <template-type-parameter name="KeyType"/>
  2572. <template-type-parameter name="KeyTypeKeyCompare"/>
  2573. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  2574. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  2575. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  2576. <method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  2577. <method name="insert_unique"><type>void</type><template>
  2578. <template-type-parameter name="Iterator"/>
  2579. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  2580. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  2581. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  2582. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  2583. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2584. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2585. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2586. <method name="erase"><type>size_type</type><template>
  2587. <template-type-parameter name="KeyType"/>
  2588. <template-type-parameter name="KeyTypeKeyCompare"/>
  2589. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2590. <method name="erase_and_dispose"><type>iterator</type><template>
  2591. <template-type-parameter name="Disposer"/>
  2592. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  2593. <method name="erase_and_dispose"><type>iterator</type><template>
  2594. <template-type-parameter name="Disposer"/>
  2595. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  2596. <method name="erase_and_dispose"><type>size_type</type><template>
  2597. <template-type-parameter name="Disposer"/>
  2598. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2599. <method name="erase_and_dispose"><type>size_type</type><template>
  2600. <template-type-parameter name="KeyType"/>
  2601. <template-type-parameter name="KeyTypeKeyCompare"/>
  2602. <template-type-parameter name="Disposer"/>
  2603. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  2604. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2605. <method name="clear_and_dispose"><type>void</type><template>
  2606. <template-type-parameter name="Disposer"/>
  2607. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  2608. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2609. <method name="count" cv="const"><type>size_type</type><template>
  2610. <template-type-parameter name="KeyType"/>
  2611. <template-type-parameter name="KeyTypeKeyCompare"/>
  2612. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2613. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2614. <method name="lower_bound"><type>iterator</type><template>
  2615. <template-type-parameter name="KeyType"/>
  2616. <template-type-parameter name="KeyTypeKeyCompare"/>
  2617. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2618. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2619. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  2620. <template-type-parameter name="KeyType"/>
  2621. <template-type-parameter name="KeyTypeKeyCompare"/>
  2622. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2623. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2624. <method name="upper_bound"><type>iterator</type><template>
  2625. <template-type-parameter name="KeyType"/>
  2626. <template-type-parameter name="KeyTypeKeyCompare"/>
  2627. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2628. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2629. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  2630. <template-type-parameter name="KeyType"/>
  2631. <template-type-parameter name="KeyTypeKeyCompare"/>
  2632. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2633. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2634. <method name="find"><type>iterator</type><template>
  2635. <template-type-parameter name="KeyType"/>
  2636. <template-type-parameter name="KeyTypeKeyCompare"/>
  2637. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2638. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2639. <method name="find" cv="const"><type>const_iterator</type><template>
  2640. <template-type-parameter name="KeyType"/>
  2641. <template-type-parameter name="KeyTypeKeyCompare"/>
  2642. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2643. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2644. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  2645. <template-type-parameter name="KeyType"/>
  2646. <template-type-parameter name="KeyTypeKeyCompare"/>
  2647. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2648. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2649. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  2650. <template-type-parameter name="KeyType"/>
  2651. <template-type-parameter name="KeyTypeKeyCompare"/>
  2652. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2653. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  2654. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  2655. <template-type-parameter name="KeyType"/>
  2656. <template-type-parameter name="KeyTypeKeyCompare"/>
  2657. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  2658. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  2659. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  2660. <template-type-parameter name="KeyType"/>
  2661. <template-type-parameter name="KeyTypeKeyCompare"/>
  2662. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  2663. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2664. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2665. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  2666. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  2667. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  2668. <method name="merge_unique"><type>void</type><template>
  2669. <template-type-parameter name="T"/>
  2670. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  2671. </template><parameter name=""><paramtype><classname>rbtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  2672. <method name="merge_equal"><type>void</type><template>
  2673. <template-type-parameter name="T"/>
  2674. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  2675. </template><parameter name=""><paramtype><classname>rbtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  2676. </method-group>
  2677. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  2678. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  2679. <constructor><template>
  2680. <template-type-parameter name="Iterator"/>
  2681. </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  2682. <constructor><parameter name="x"><paramtype><classname>rbtree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  2683. <copy-assignment><type><classname>rbtree</classname> &amp;</type><parameter name="x"><paramtype><classname>rbtree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  2684. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  2685. <method-group name="public static functions">
  2686. <method name="container_from_end_iterator" specifiers="static"><type><classname>rbtree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2687. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>rbtree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2688. <method name="container_from_iterator" specifiers="static"><type><classname>rbtree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  2689. <method name="container_from_iterator" specifiers="static"><type>const <classname>rbtree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  2690. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  2691. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  2692. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  2693. </method-group>
  2694. </class>
  2695. </namespace>
  2696. </namespace>
  2697. </header>
  2698. <header name="boost/intrusive/rbtree_algorithms.hpp">
  2699. <namespace name="boost">
  2700. <namespace name="intrusive">
  2701. <class name="rbtree_algorithms"><template>
  2702. <template-type-parameter name="NodeTraits"/>
  2703. </template><description><para><classname alt="boost::intrusive::rbtree_algorithms">rbtree_algorithms</classname> provides basic algorithms to manipulate nodes forming a red-black tree. The insertion and deletion algorithms are based on those in Cormen, Leiserson, and Rivest, Introduction to Algorithms (MIT Press, 1990), except that</para><para>(1) the header node is maintained with links not only to the root but also to the leftmost node of the tree, to enable constant time begin(), and to the rightmost node of the tree, to enable linear time performance when used with the generic set algorithms (set_union, etc.);</para><para>(2) when a node being deleted has two children its successor node is relinked into its place, rather than copied, so that the only pointers invalidated are those referring to the deleted node.</para><para><classname alt="boost::intrusive::rbtree_algorithms">rbtree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><computeroutput>color</computeroutput>: The type that can store the color of a node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput></para><para><computeroutput>static color get_color(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_color(node_ptr n, color c);</computeroutput></para><para><computeroutput>static color black();</computeroutput></para><para><computeroutput>static color red();</computeroutput> </para></description><typedef name="node_traits"><type>NodeTraits</type></typedef>
  2704. <typedef name="node"><type>NodeTraits::node</type></typedef>
  2705. <typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
  2706. <typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
  2707. <typedef name="color"><type>NodeTraits::color</type></typedef>
  2708. <typedef name="insert_commit_data"><description><para>This type is the information that will be filled by insert_unique_check </para></description><type>bstree_algo::insert_commit_data</type></typedef>
  2709. <method-group name="public static functions">
  2710. <method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2711. <method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2712. <method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2713. <method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2714. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  2715. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  2716. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
  2717. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
  2718. <method name="unlink" specifiers="static"><type>void</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2719. <method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
  2720. <method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2721. <method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2722. <method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2723. <method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2724. <method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  2725. <method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  2726. <method name="erase" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2727. <method name="transfer_unique" specifiers="static"><type>bool</type><template>
  2728. <template-type-parameter name="NodePtrCompare"/>
  2729. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  2730. <method name="transfer_equal" specifiers="static"><type>void</type><template>
  2731. <template-type-parameter name="NodePtrCompare"/>
  2732. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  2733. <method name="clone" specifiers="static"><type>void</type><template>
  2734. <template-type-parameter name="Cloner"/>
  2735. <template-type-parameter name="Disposer"/>
  2736. </template><parameter name="source_header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  2737. <method name="clear_and_dispose" specifiers="static"><type>void</type><template>
  2738. <template-type-parameter name="Disposer"/>
  2739. </template><parameter name="header"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  2740. <method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
  2741. <template-type-parameter name="KeyType"/>
  2742. <template-type-parameter name="KeyNodePtrCompare"/>
  2743. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  2744. <method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
  2745. <template-type-parameter name="KeyType"/>
  2746. <template-type-parameter name="KeyNodePtrCompare"/>
  2747. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  2748. <method name="find" specifiers="static"><type>node_ptr</type><template>
  2749. <template-type-parameter name="KeyType"/>
  2750. <template-type-parameter name="KeyNodePtrCompare"/>
  2751. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  2752. <method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  2753. <template-type-parameter name="KeyType"/>
  2754. <template-type-parameter name="KeyNodePtrCompare"/>
  2755. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  2756. <method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  2757. <template-type-parameter name="KeyType"/>
  2758. <template-type-parameter name="KeyNodePtrCompare"/>
  2759. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
  2760. <method name="count" specifiers="static"><type>std::size_t</type><template>
  2761. <template-type-parameter name="KeyType"/>
  2762. <template-type-parameter name="KeyNodePtrCompare"/>
  2763. </template><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  2764. <method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
  2765. <template-type-parameter name="NodePtrCompare"/>
  2766. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  2767. <method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
  2768. <template-type-parameter name="NodePtrCompare"/>
  2769. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  2770. <method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
  2771. <template-type-parameter name="NodePtrCompare"/>
  2772. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  2773. <method name="insert_before" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
  2774. <method name="push_back" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  2775. <method name="push_front" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  2776. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  2777. <template-type-parameter name="KeyType"/>
  2778. <template-type-parameter name="KeyNodePtrCompare"/>
  2779. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  2780. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  2781. <template-type-parameter name="KeyType"/>
  2782. <template-type-parameter name="KeyNodePtrCompare"/>
  2783. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  2784. <method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  2785. <method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2786. </method-group>
  2787. </class>
  2788. </namespace>
  2789. </namespace>
  2790. </header>
  2791. <header name="boost/intrusive/set.hpp">
  2792. <namespace name="boost">
  2793. <namespace name="intrusive">
  2794. <struct name="make_multiset"><template>
  2795. <template-type-parameter name="T"/>
  2796. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2797. </template><description><para>Helper metafunction to define a <computeroutput>multiset</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  2798. </struct><struct name="make_set"><template>
  2799. <template-type-parameter name="T"/>
  2800. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2801. </template><description><para>Helper metafunction to define a <computeroutput>set</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  2802. </struct><class name="multiset"><template>
  2803. <template-type-parameter name="T"/>
  2804. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2805. </template><description><para>The class template multiset is an intrusive container, that mimics most of the interface of std::multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  2806. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  2807. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  2808. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  2809. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  2810. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  2811. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  2812. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  2813. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  2814. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  2815. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  2816. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  2817. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  2818. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  2819. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  2820. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  2821. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  2822. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  2823. <typedef name="node"><type>implementation_defined::node</type></typedef>
  2824. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  2825. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  2826. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  2827. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  2828. <method-group name="public member functions">
  2829. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2830. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2831. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2832. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2833. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2834. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2835. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2836. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2837. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2838. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2839. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2840. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2841. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2842. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2843. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2844. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  2845. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  2846. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2847. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2848. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  2849. <method name="clone_from"><type>void</type><template>
  2850. <template-type-parameter name="Cloner"/>
  2851. <template-type-parameter name="Disposer"/>
  2852. </template><parameter name="src"><paramtype>const <classname>multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  2853. <method name="clone_from"><type>void</type><template>
  2854. <template-type-parameter name="Cloner"/>
  2855. <template-type-parameter name="Disposer"/>
  2856. </template><parameter name="src"><paramtype><classname>multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  2857. <method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  2858. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  2859. <method name="insert"><type>void</type><template>
  2860. <template-type-parameter name="Iterator"/>
  2861. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  2862. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  2863. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  2864. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  2865. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2866. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2867. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2868. <method name="erase"><type>size_type</type><template>
  2869. <template-type-parameter name="KeyType"/>
  2870. <template-type-parameter name="KeyTypeKeyCompare"/>
  2871. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2872. <method name="erase_and_dispose"><type>iterator</type><template>
  2873. <template-type-parameter name="Disposer"/>
  2874. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  2875. <method name="erase_and_dispose"><type>iterator</type><template>
  2876. <template-type-parameter name="Disposer"/>
  2877. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  2878. <method name="erase_and_dispose"><type>size_type</type><template>
  2879. <template-type-parameter name="Disposer"/>
  2880. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2881. <method name="erase_and_dispose"><type>size_type</type><template>
  2882. <template-type-parameter name="KeyType"/>
  2883. <template-type-parameter name="KeyTypeKeyCompare"/>
  2884. <template-type-parameter name="Disposer"/>
  2885. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  2886. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  2887. <method name="clear_and_dispose"><type>void</type><template>
  2888. <template-type-parameter name="Disposer"/>
  2889. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  2890. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2891. <method name="count" cv="const"><type>size_type</type><template>
  2892. <template-type-parameter name="KeyType"/>
  2893. <template-type-parameter name="KeyTypeKeyCompare"/>
  2894. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2895. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2896. <method name="lower_bound"><type>iterator</type><template>
  2897. <template-type-parameter name="KeyType"/>
  2898. <template-type-parameter name="KeyTypeKeyCompare"/>
  2899. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2900. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2901. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  2902. <template-type-parameter name="KeyType"/>
  2903. <template-type-parameter name="KeyTypeKeyCompare"/>
  2904. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2905. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2906. <method name="upper_bound"><type>iterator</type><template>
  2907. <template-type-parameter name="KeyType"/>
  2908. <template-type-parameter name="KeyTypeKeyCompare"/>
  2909. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2910. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2911. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  2912. <template-type-parameter name="KeyType"/>
  2913. <template-type-parameter name="KeyTypeKeyCompare"/>
  2914. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2915. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2916. <method name="find"><type>iterator</type><template>
  2917. <template-type-parameter name="KeyType"/>
  2918. <template-type-parameter name="KeyTypeKeyCompare"/>
  2919. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2920. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2921. <method name="find" cv="const"><type>const_iterator</type><template>
  2922. <template-type-parameter name="KeyType"/>
  2923. <template-type-parameter name="KeyTypeKeyCompare"/>
  2924. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2925. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2926. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  2927. <template-type-parameter name="KeyType"/>
  2928. <template-type-parameter name="KeyTypeKeyCompare"/>
  2929. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2930. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  2931. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  2932. <template-type-parameter name="KeyType"/>
  2933. <template-type-parameter name="KeyTypeKeyCompare"/>
  2934. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  2935. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  2936. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  2937. <template-type-parameter name="KeyType"/>
  2938. <template-type-parameter name="KeyTypeKeyCompare"/>
  2939. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  2940. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  2941. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  2942. <template-type-parameter name="KeyType"/>
  2943. <template-type-parameter name="KeyTypeKeyCompare"/>
  2944. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  2945. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2946. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  2947. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  2948. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  2949. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  2950. <method name="merge"><type>void</type><template>
  2951. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  2952. </template><parameter name="source"><paramtype><classname>multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  2953. <method name="merge"><type>void</type><template>
  2954. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  2955. </template><parameter name="source"><paramtype><classname>set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  2956. </method-group>
  2957. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  2958. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  2959. <constructor><template>
  2960. <template-type-parameter name="Iterator"/>
  2961. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  2962. <constructor><parameter name="x"><paramtype><classname>multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  2963. <copy-assignment><type><classname>multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  2964. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  2965. <method-group name="public static functions">
  2966. <method name="container_from_end_iterator" specifiers="static"><type><classname>multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2967. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  2968. <method name="container_from_iterator" specifiers="static"><type><classname>multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  2969. <method name="container_from_iterator" specifiers="static"><type>const <classname>multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  2970. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  2971. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  2972. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  2973. </method-group>
  2974. </class><class name="set"><template>
  2975. <template-type-parameter name="T"/>
  2976. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  2977. </template><description><para>The class template set is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  2978. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  2979. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  2980. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  2981. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  2982. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  2983. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  2984. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  2985. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  2986. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  2987. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  2988. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  2989. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  2990. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  2991. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  2992. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  2993. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  2994. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  2995. <typedef name="node"><type>implementation_defined::node</type></typedef>
  2996. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  2997. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  2998. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  2999. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  3000. <method-group name="public member functions">
  3001. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3002. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3003. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3004. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3005. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3006. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3007. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3008. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3009. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3010. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3011. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3012. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3013. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3014. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3015. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3016. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  3017. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  3018. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3019. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3020. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  3021. <method name="clone_from"><type>void</type><template>
  3022. <template-type-parameter name="Cloner"/>
  3023. <template-type-parameter name="Disposer"/>
  3024. </template><parameter name="src"><paramtype>const <classname>set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  3025. <method name="clone_from"><type>void</type><template>
  3026. <template-type-parameter name="Cloner"/>
  3027. <template-type-parameter name="Disposer"/>
  3028. </template><parameter name="src"><paramtype><classname>set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  3029. <method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3030. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3031. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  3032. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  3033. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  3034. <template-type-parameter name="KeyType"/>
  3035. <template-type-parameter name="KeyTypeKeyCompare"/>
  3036. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  3037. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  3038. <template-type-parameter name="KeyType"/>
  3039. <template-type-parameter name="KeyTypeKeyCompare"/>
  3040. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  3041. <method name="insert"><type>void</type><template>
  3042. <template-type-parameter name="Iterator"/>
  3043. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3044. <method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  3045. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3046. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3047. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3048. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3049. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3050. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3051. <method name="erase"><type>size_type</type><template>
  3052. <template-type-parameter name="KeyType"/>
  3053. <template-type-parameter name="KeyTypeKeyCompare"/>
  3054. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3055. <method name="erase_and_dispose"><type>iterator</type><template>
  3056. <template-type-parameter name="Disposer"/>
  3057. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3058. <method name="erase_and_dispose"><type>iterator</type><template>
  3059. <template-type-parameter name="Disposer"/>
  3060. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3061. <method name="erase_and_dispose"><type>size_type</type><template>
  3062. <template-type-parameter name="Disposer"/>
  3063. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3064. <method name="erase_and_dispose"><type>size_type</type><template>
  3065. <template-type-parameter name="KeyType"/>
  3066. <template-type-parameter name="KeyTypeKeyCompare"/>
  3067. <template-type-parameter name="Disposer"/>
  3068. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3069. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3070. <method name="clear_and_dispose"><type>void</type><template>
  3071. <template-type-parameter name="Disposer"/>
  3072. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  3073. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3074. <method name="count" cv="const"><type>size_type</type><template>
  3075. <template-type-parameter name="KeyType"/>
  3076. <template-type-parameter name="KeyTypeKeyCompare"/>
  3077. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3078. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3079. <method name="lower_bound"><type>iterator</type><template>
  3080. <template-type-parameter name="KeyType"/>
  3081. <template-type-parameter name="KeyTypeKeyCompare"/>
  3082. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3083. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3084. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  3085. <template-type-parameter name="KeyType"/>
  3086. <template-type-parameter name="KeyTypeKeyCompare"/>
  3087. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3088. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3089. <method name="upper_bound"><type>iterator</type><template>
  3090. <template-type-parameter name="KeyType"/>
  3091. <template-type-parameter name="KeyTypeKeyCompare"/>
  3092. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3093. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3094. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  3095. <template-type-parameter name="KeyType"/>
  3096. <template-type-parameter name="KeyTypeKeyCompare"/>
  3097. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3098. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3099. <method name="find"><type>iterator</type><template>
  3100. <template-type-parameter name="KeyType"/>
  3101. <template-type-parameter name="KeyTypeKeyCompare"/>
  3102. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3103. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3104. <method name="find" cv="const"><type>const_iterator</type><template>
  3105. <template-type-parameter name="KeyType"/>
  3106. <template-type-parameter name="KeyTypeKeyCompare"/>
  3107. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3108. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3109. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  3110. <template-type-parameter name="KeyType"/>
  3111. <template-type-parameter name="KeyTypeKeyCompare"/>
  3112. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3113. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3114. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  3115. <template-type-parameter name="KeyType"/>
  3116. <template-type-parameter name="KeyTypeKeyCompare"/>
  3117. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3118. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3119. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  3120. <template-type-parameter name="KeyType"/>
  3121. <template-type-parameter name="KeyTypeKeyCompare"/>
  3122. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3123. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3124. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  3125. <template-type-parameter name="KeyType"/>
  3126. <template-type-parameter name="KeyTypeKeyCompare"/>
  3127. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3128. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3129. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3130. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  3131. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  3132. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  3133. <method name="merge"><type>void</type><template>
  3134. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  3135. </template><parameter name="source"><paramtype><classname>set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  3136. <method name="merge"><type>void</type><template>
  3137. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  3138. </template><parameter name="source"><paramtype><classname>multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  3139. </method-group>
  3140. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3141. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3142. <constructor><template>
  3143. <template-type-parameter name="Iterator"/>
  3144. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3145. <constructor><parameter name="x"><paramtype><classname>set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  3146. <copy-assignment><type><classname>set</classname> &amp;</type><parameter name="x"><paramtype><classname>set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  3147. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  3148. <method-group name="public static functions">
  3149. <method name="container_from_end_iterator" specifiers="static"><type><classname>set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3150. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3151. <method name="container_from_iterator" specifiers="static"><type><classname>set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  3152. <method name="container_from_iterator" specifiers="static"><type>const <classname>set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  3153. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  3154. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  3155. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  3156. </method-group>
  3157. </class>
  3158. <function name="operator!="><type>bool</type><template>
  3159. <template-type-parameter name="T"/>
  3160. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3161. </template><parameter name="x"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3162. <function name="operator&gt;"><type>bool</type><template>
  3163. <template-type-parameter name="T"/>
  3164. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3165. </template><parameter name="x"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3166. <function name="operator&lt;="><type>bool</type><template>
  3167. <template-type-parameter name="T"/>
  3168. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3169. </template><parameter name="x"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3170. <function name="operator&gt;="><type>bool</type><template>
  3171. <template-type-parameter name="T"/>
  3172. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3173. </template><parameter name="x"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3174. <function name="swap"><type>void</type><template>
  3175. <template-type-parameter name="T"/>
  3176. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3177. </template><parameter name="x"><paramtype><classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3178. <function name="operator!="><type>bool</type><template>
  3179. <template-type-parameter name="T"/>
  3180. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3181. </template><parameter name="x"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3182. <function name="operator&gt;"><type>bool</type><template>
  3183. <template-type-parameter name="T"/>
  3184. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3185. </template><parameter name="x"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3186. <function name="operator&lt;="><type>bool</type><template>
  3187. <template-type-parameter name="T"/>
  3188. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3189. </template><parameter name="x"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3190. <function name="operator&gt;="><type>bool</type><template>
  3191. <template-type-parameter name="T"/>
  3192. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3193. </template><parameter name="x"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3194. <function name="swap"><type>void</type><template>
  3195. <template-type-parameter name="T"/>
  3196. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3197. </template><parameter name="x"><paramtype><classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3198. </namespace>
  3199. </namespace>
  3200. </header>
  3201. <header name="boost/intrusive/set_hook.hpp">
  3202. <namespace name="boost">
  3203. <namespace name="intrusive">
  3204. <struct name="make_set_base_hook"><template>
  3205. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3206. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::set_base_hook">set_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  3207. </struct><struct name="make_set_member_hook"><template>
  3208. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3209. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::set_member_hook">set_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  3210. </struct><class name="set_base_hook"><template>
  3211. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3212. </template><inherit access="public">make_set_base_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::set_base_hook">set_base_hook</classname> in order to store objects in in a set/multiset. <classname alt="boost::intrusive::set_base_hook">set_base_hook</classname> holds the data necessary to maintain the set/multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for set/multiset.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>optimize_size&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>optimize_size&lt;&gt;</computeroutput> will tell the hook to optimize the hook for size instead of speed. </para></description><method-group name="public member functions">
  3213. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3214. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  3215. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3216. </method-group>
  3217. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  3218. <constructor><parameter name=""><paramtype>const <classname>set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  3219. <copy-assignment><type><classname>set_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  3220. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  3221. </class><class name="set_member_hook"><template>
  3222. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3223. </template><inherit access="public">make_set_member_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::set_member_hook">set_member_hook</classname> in order to store objects of this class in a set/multiset. <classname alt="boost::intrusive::set_member_hook">set_member_hook</classname> holds the data necessary for maintaining the set/multiset and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for set/multiset.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>optimize_size&lt;&gt;</computeroutput>.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>optimize_size&lt;&gt;</computeroutput> will tell the hook to optimize the hook for size instead of speed. </para></description><method-group name="public member functions">
  3224. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3225. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  3226. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3227. </method-group>
  3228. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  3229. <constructor><parameter name=""><paramtype>const <classname>set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  3230. <copy-assignment><type><classname>set_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  3231. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in a set an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  3232. </class>
  3233. </namespace>
  3234. </namespace>
  3235. </header>
  3236. <header name="boost/intrusive/sg_set.hpp">
  3237. <namespace name="boost">
  3238. <namespace name="intrusive">
  3239. <struct name="make_sg_multiset"><template>
  3240. <template-type-parameter name="T"/>
  3241. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3242. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::sg_multiset">sg_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  3243. </struct><struct name="make_sg_set"><template>
  3244. <template-type-parameter name="T"/>
  3245. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3246. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::sg_set">sg_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  3247. </struct><class name="sg_multiset"><template>
  3248. <template-type-parameter name="T"/>
  3249. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3250. </template><description><para>The class template <classname alt="boost::intrusive::sg_multiset">sg_multiset</classname> is an intrusive container, that mimics most of the interface of std::sg_multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>floating_point&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  3251. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  3252. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  3253. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  3254. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  3255. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  3256. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  3257. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  3258. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  3259. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  3260. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  3261. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  3262. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  3263. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  3264. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  3265. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  3266. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  3267. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  3268. <typedef name="node"><type>implementation_defined::node</type></typedef>
  3269. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  3270. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  3271. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  3272. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  3273. <method-group name="public member functions">
  3274. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3275. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3276. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3277. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3278. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3279. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3280. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3281. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3282. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3283. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3284. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3285. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3286. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3287. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3288. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3289. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  3290. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  3291. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3292. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3293. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>sg_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  3294. <method name="clone_from"><type>void</type><template>
  3295. <template-type-parameter name="Cloner"/>
  3296. <template-type-parameter name="Disposer"/>
  3297. </template><parameter name="src"><paramtype>const <classname>sg_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
  3298. <method name="clone_from"><type>void</type><template>
  3299. <template-type-parameter name="Cloner"/>
  3300. <template-type-parameter name="Disposer"/>
  3301. </template><parameter name="src"><paramtype><classname>sg_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
  3302. <method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3303. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3304. <method name="insert"><type>void</type><template>
  3305. <template-type-parameter name="Iterator"/>
  3306. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3307. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3308. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3309. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3310. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3311. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3312. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3313. <method name="erase"><type>size_type</type><template>
  3314. <template-type-parameter name="KeyType"/>
  3315. <template-type-parameter name="KeyTypeKeyCompare"/>
  3316. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3317. <method name="erase_and_dispose"><type>iterator</type><template>
  3318. <template-type-parameter name="Disposer"/>
  3319. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3320. <method name="erase_and_dispose"><type>iterator</type><template>
  3321. <template-type-parameter name="Disposer"/>
  3322. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3323. <method name="erase_and_dispose"><type>size_type</type><template>
  3324. <template-type-parameter name="Disposer"/>
  3325. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3326. <method name="erase_and_dispose"><type>size_type</type><template>
  3327. <template-type-parameter name="KeyType"/>
  3328. <template-type-parameter name="KeyTypeKeyCompare"/>
  3329. <template-type-parameter name="Disposer"/>
  3330. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3331. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3332. <method name="clear_and_dispose"><type>void</type><template>
  3333. <template-type-parameter name="Disposer"/>
  3334. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  3335. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3336. <method name="count" cv="const"><type>size_type</type><template>
  3337. <template-type-parameter name="KeyType"/>
  3338. <template-type-parameter name="KeyTypeKeyCompare"/>
  3339. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3340. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3341. <method name="lower_bound"><type>iterator</type><template>
  3342. <template-type-parameter name="KeyType"/>
  3343. <template-type-parameter name="KeyTypeKeyCompare"/>
  3344. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3345. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3346. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  3347. <template-type-parameter name="KeyType"/>
  3348. <template-type-parameter name="KeyTypeKeyCompare"/>
  3349. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3350. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3351. <method name="upper_bound"><type>iterator</type><template>
  3352. <template-type-parameter name="KeyType"/>
  3353. <template-type-parameter name="KeyTypeKeyCompare"/>
  3354. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3355. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3356. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  3357. <template-type-parameter name="KeyType"/>
  3358. <template-type-parameter name="KeyTypeKeyCompare"/>
  3359. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3360. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3361. <method name="find"><type>iterator</type><template>
  3362. <template-type-parameter name="KeyType"/>
  3363. <template-type-parameter name="KeyTypeKeyCompare"/>
  3364. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3365. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3366. <method name="find" cv="const"><type>const_iterator</type><template>
  3367. <template-type-parameter name="KeyType"/>
  3368. <template-type-parameter name="KeyTypeKeyCompare"/>
  3369. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3370. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3371. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  3372. <template-type-parameter name="KeyType"/>
  3373. <template-type-parameter name="KeyTypeKeyCompare"/>
  3374. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3375. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3376. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  3377. <template-type-parameter name="KeyType"/>
  3378. <template-type-parameter name="KeyTypeKeyCompare"/>
  3379. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3380. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3381. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  3382. <template-type-parameter name="KeyType"/>
  3383. <template-type-parameter name="KeyTypeKeyCompare"/>
  3384. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3385. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3386. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  3387. <template-type-parameter name="KeyType"/>
  3388. <template-type-parameter name="KeyTypeKeyCompare"/>
  3389. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3390. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3391. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3392. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  3393. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  3394. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  3395. <method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  3396. <method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  3397. <method name="balance_factor" cv="const"><type>float</type><description><para><emphasis role="bold">Returns</emphasis>: The balance factor (alpha) used in this tree</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3398. <method name="balance_factor"><type>void</type><parameter name="new_alpha"><paramtype>float</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_alpha must be a value between 0.5 and 1.0</para><para><emphasis role="bold">Effects</emphasis>: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  3399. <method name="merge"><type>void</type><template>
  3400. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  3401. </template><parameter name="source"><paramtype><classname>sg_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  3402. <method name="merge"><type>void</type><template>
  3403. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  3404. </template><parameter name="source"><paramtype><classname>sg_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  3405. </method-group>
  3406. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3407. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3408. <constructor><template>
  3409. <template-type-parameter name="Iterator"/>
  3410. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3411. <constructor><parameter name="x"><paramtype><classname>sg_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  3412. <copy-assignment><type><classname>sg_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>sg_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  3413. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  3414. <method-group name="public static functions">
  3415. <method name="container_from_end_iterator" specifiers="static"><type><classname>sg_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3416. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>sg_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3417. <method name="container_from_iterator" specifiers="static"><type><classname>sg_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  3418. <method name="container_from_iterator" specifiers="static"><type>const <classname>sg_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  3419. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  3420. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  3421. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  3422. </method-group>
  3423. </class><class name="sg_set"><template>
  3424. <template-type-parameter name="T"/>
  3425. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3426. </template><description><para>The class template <classname alt="boost::intrusive::sg_set">sg_set</classname> is an intrusive container, that mimics most of the interface of std::sg_set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>floating_point&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  3427. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  3428. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  3429. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  3430. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  3431. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  3432. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  3433. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  3434. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  3435. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  3436. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  3437. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  3438. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  3439. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  3440. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  3441. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  3442. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  3443. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  3444. <typedef name="node"><type>implementation_defined::node</type></typedef>
  3445. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  3446. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  3447. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  3448. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  3449. <method-group name="public member functions">
  3450. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3451. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3452. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3453. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3454. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3455. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3456. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3457. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3458. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3459. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3460. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3461. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3462. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3463. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3464. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3465. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  3466. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  3467. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3468. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3469. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>sg_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  3470. <method name="clone_from"><type>void</type><template>
  3471. <template-type-parameter name="Cloner"/>
  3472. <template-type-parameter name="Disposer"/>
  3473. </template><parameter name="src"><paramtype>const <classname>sg_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
  3474. <method name="clone_from"><type>void</type><template>
  3475. <template-type-parameter name="Cloner"/>
  3476. <template-type-parameter name="Disposer"/>
  3477. </template><parameter name="src"><paramtype><classname>sg_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
  3478. <method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3479. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3480. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  3481. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  3482. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  3483. <template-type-parameter name="KeyType"/>
  3484. <template-type-parameter name="KeyTypeKeyCompare"/>
  3485. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  3486. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  3487. <template-type-parameter name="KeyType"/>
  3488. <template-type-parameter name="KeyTypeKeyCompare"/>
  3489. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  3490. <method name="insert"><type>void</type><template>
  3491. <template-type-parameter name="Iterator"/>
  3492. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3493. <method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  3494. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3495. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3496. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3497. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3498. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3499. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3500. <method name="erase"><type>size_type</type><template>
  3501. <template-type-parameter name="KeyType"/>
  3502. <template-type-parameter name="KeyTypeKeyCompare"/>
  3503. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3504. <method name="erase_and_dispose"><type>iterator</type><template>
  3505. <template-type-parameter name="Disposer"/>
  3506. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3507. <method name="erase_and_dispose"><type>iterator</type><template>
  3508. <template-type-parameter name="Disposer"/>
  3509. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3510. <method name="erase_and_dispose"><type>size_type</type><template>
  3511. <template-type-parameter name="Disposer"/>
  3512. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3513. <method name="erase_and_dispose"><type>size_type</type><template>
  3514. <template-type-parameter name="KeyType"/>
  3515. <template-type-parameter name="KeyTypeKeyCompare"/>
  3516. <template-type-parameter name="Disposer"/>
  3517. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3518. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3519. <method name="clear_and_dispose"><type>void</type><template>
  3520. <template-type-parameter name="Disposer"/>
  3521. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  3522. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3523. <method name="count" cv="const"><type>size_type</type><template>
  3524. <template-type-parameter name="KeyType"/>
  3525. <template-type-parameter name="KeyTypeKeyCompare"/>
  3526. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3527. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3528. <method name="lower_bound"><type>iterator</type><template>
  3529. <template-type-parameter name="KeyType"/>
  3530. <template-type-parameter name="KeyTypeKeyCompare"/>
  3531. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3532. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3533. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  3534. <template-type-parameter name="KeyType"/>
  3535. <template-type-parameter name="KeyTypeKeyCompare"/>
  3536. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3537. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3538. <method name="upper_bound"><type>iterator</type><template>
  3539. <template-type-parameter name="KeyType"/>
  3540. <template-type-parameter name="KeyTypeKeyCompare"/>
  3541. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3542. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3543. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  3544. <template-type-parameter name="KeyType"/>
  3545. <template-type-parameter name="KeyTypeKeyCompare"/>
  3546. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3547. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3548. <method name="find"><type>iterator</type><template>
  3549. <template-type-parameter name="KeyType"/>
  3550. <template-type-parameter name="KeyTypeKeyCompare"/>
  3551. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3552. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3553. <method name="find" cv="const"><type>const_iterator</type><template>
  3554. <template-type-parameter name="KeyType"/>
  3555. <template-type-parameter name="KeyTypeKeyCompare"/>
  3556. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3557. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3558. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  3559. <template-type-parameter name="KeyType"/>
  3560. <template-type-parameter name="KeyTypeKeyCompare"/>
  3561. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3562. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3563. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  3564. <template-type-parameter name="KeyType"/>
  3565. <template-type-parameter name="KeyTypeKeyCompare"/>
  3566. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3567. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3568. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  3569. <template-type-parameter name="KeyType"/>
  3570. <template-type-parameter name="KeyTypeKeyCompare"/>
  3571. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3572. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3573. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  3574. <template-type-parameter name="KeyType"/>
  3575. <template-type-parameter name="KeyTypeKeyCompare"/>
  3576. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3577. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3578. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3579. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  3580. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  3581. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  3582. <method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  3583. <method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  3584. <method name="balance_factor" cv="const"><type>float</type><description><para><emphasis role="bold">Returns</emphasis>: The balance factor (alpha) used in this tree</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3585. <method name="balance_factor"><type>void</type><parameter name="new_alpha"><paramtype>float</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_alpha must be a value between 0.5 and 1.0</para><para><emphasis role="bold">Effects</emphasis>: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  3586. <method name="merge"><type>void</type><template>
  3587. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  3588. </template><parameter name="source"><paramtype><classname>sg_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  3589. <method name="merge"><type>void</type><template>
  3590. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  3591. </template><parameter name="source"><paramtype><classname>sg_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  3592. </method-group>
  3593. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3594. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3595. <constructor><template>
  3596. <template-type-parameter name="Iterator"/>
  3597. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3598. <constructor><parameter name="x"><paramtype><classname>sg_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  3599. <copy-assignment><type><classname>sg_set</classname> &amp;</type><parameter name="x"><paramtype><classname>sg_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  3600. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  3601. <method-group name="public static functions">
  3602. <method name="container_from_end_iterator" specifiers="static"><type><classname>sg_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3603. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>sg_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3604. <method name="container_from_iterator" specifiers="static"><type><classname>sg_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  3605. <method name="container_from_iterator" specifiers="static"><type>const <classname>sg_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  3606. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  3607. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  3608. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  3609. </method-group>
  3610. </class>
  3611. <function name="operator!="><type>bool</type><template>
  3612. <template-type-parameter name="T"/>
  3613. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3614. </template><parameter name="x"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3615. <function name="operator&gt;"><type>bool</type><template>
  3616. <template-type-parameter name="T"/>
  3617. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3618. </template><parameter name="x"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3619. <function name="operator&lt;="><type>bool</type><template>
  3620. <template-type-parameter name="T"/>
  3621. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3622. </template><parameter name="x"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3623. <function name="operator&gt;="><type>bool</type><template>
  3624. <template-type-parameter name="T"/>
  3625. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3626. </template><parameter name="x"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3627. <function name="swap"><type>void</type><template>
  3628. <template-type-parameter name="T"/>
  3629. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3630. </template><parameter name="x"><paramtype><classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>sg_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3631. <function name="operator!="><type>bool</type><template>
  3632. <template-type-parameter name="T"/>
  3633. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3634. </template><parameter name="x"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3635. <function name="operator&gt;"><type>bool</type><template>
  3636. <template-type-parameter name="T"/>
  3637. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3638. </template><parameter name="x"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3639. <function name="operator&lt;="><type>bool</type><template>
  3640. <template-type-parameter name="T"/>
  3641. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3642. </template><parameter name="x"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3643. <function name="operator&gt;="><type>bool</type><template>
  3644. <template-type-parameter name="T"/>
  3645. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3646. </template><parameter name="x"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3647. <function name="swap"><type>void</type><template>
  3648. <template-type-parameter name="T"/>
  3649. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3650. </template><parameter name="x"><paramtype><classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>sg_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  3651. </namespace>
  3652. </namespace>
  3653. </header>
  3654. <header name="boost/intrusive/sgtree.hpp">
  3655. <namespace name="boost">
  3656. <namespace name="intrusive">
  3657. <struct name="make_sgtree"><template>
  3658. <template-type-parameter name="T"/>
  3659. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3660. </template><description><para>Helper metafunction to define a <computeroutput>sgtree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  3661. </struct><class name="sgtree"><template>
  3662. <template-type-parameter name="T"/>
  3663. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3664. </template><description><para>The class template sgtree is an intrusive scapegoat tree container, that is used to construct intrusive <classname alt="boost::intrusive::sg_set">sg_set</classname> and <classname alt="boost::intrusive::sg_multiset">sg_multiset</classname> containers. The no-throw guarantee holds only, if the value_compare object doesn't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>floating_point&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
  3665. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  3666. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  3667. <typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  3668. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  3669. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  3670. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  3671. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  3672. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  3673. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  3674. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  3675. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  3676. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  3677. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  3678. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  3679. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  3680. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  3681. <typedef name="node"><type>implementation_defined::node</type></typedef>
  3682. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  3683. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  3684. <typedef name="node_algorithms"><type>implementation_defined</type></typedef>
  3685. <typedef name="insert_commit_data"><type>implementation_defined</type></typedef>
  3686. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  3687. <data-member name="floating_point" specifiers="static"><type>const bool</type></data-member>
  3688. <data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
  3689. <method-group name="public member functions">
  3690. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3691. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3692. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3693. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3694. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3695. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3696. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3697. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3698. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3699. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3700. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3701. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3702. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3703. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3704. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3705. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  3706. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  3707. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3708. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3709. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>sgtree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  3710. <method name="clone_from"><type>void</type><template>
  3711. <template-type-parameter name="Cloner"/>
  3712. <template-type-parameter name="Disposer"/>
  3713. </template><parameter name="src"><paramtype>const <classname>sgtree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
  3714. <method name="clone_from"><type>void</type><template>
  3715. <template-type-parameter name="Cloner"/>
  3716. <template-type-parameter name="Disposer"/>
  3717. </template><parameter name="src"><paramtype><classname>sgtree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
  3718. <method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3719. <method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3720. <method name="insert_equal"><type>void</type><template>
  3721. <template-type-parameter name="Iterator"/>
  3722. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3723. <method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3724. <method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3725. <method name="insert_unique_check"><type>std::pair&lt; iterator BOOST_INTRUSIVE_I bool &gt;</type><template>
  3726. <template-type-parameter name="KeyType"/>
  3727. <template-type-parameter name="KeyTypeKeyCompare"/>
  3728. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  3729. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  3730. <template-type-parameter name="KeyType"/>
  3731. <template-type-parameter name="KeyTypeKeyCompare"/>
  3732. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  3733. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  3734. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  3735. <method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  3736. <method name="insert_unique"><type>void</type><template>
  3737. <template-type-parameter name="Iterator"/>
  3738. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  3739. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3740. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3741. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  3742. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3743. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3744. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3745. <method name="erase"><type>size_type</type><template>
  3746. <template-type-parameter name="KeyType"/>
  3747. <template-type-parameter name="KeyTypeKeyCompare"/>
  3748. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3749. <method name="erase_and_dispose"><type>iterator</type><template>
  3750. <template-type-parameter name="Disposer"/>
  3751. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3752. <method name="erase_and_dispose"><type>iterator</type><template>
  3753. <template-type-parameter name="Disposer"/>
  3754. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3755. <method name="erase_and_dispose"><type>size_type</type><template>
  3756. <template-type-parameter name="Disposer"/>
  3757. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3758. <method name="erase_and_dispose"><type>size_type</type><template>
  3759. <template-type-parameter name="KeyType"/>
  3760. <template-type-parameter name="KeyTypeKeyCompare"/>
  3761. <template-type-parameter name="Disposer"/>
  3762. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  3763. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  3764. <method name="clear_and_dispose"><type>void</type><template>
  3765. <template-type-parameter name="Disposer"/>
  3766. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  3767. <method name="merge_unique"><type>void</type><template>
  3768. <template-type-parameter name="T"/>
  3769. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  3770. </template><parameter name=""><paramtype><classname>sgtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  3771. <method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
  3772. <method name="merge_equal"><type>void</type><template>
  3773. <template-type-parameter name="T"/>
  3774. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  3775. </template><parameter name=""><paramtype><classname>sgtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  3776. <method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
  3777. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3778. <method name="count" cv="const"><type>size_type</type><template>
  3779. <template-type-parameter name="KeyType"/>
  3780. <template-type-parameter name="KeyTypeKeyCompare"/>
  3781. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3782. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3783. <method name="lower_bound"><type>iterator</type><template>
  3784. <template-type-parameter name="KeyType"/>
  3785. <template-type-parameter name="KeyTypeKeyCompare"/>
  3786. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3787. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3788. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  3789. <template-type-parameter name="KeyType"/>
  3790. <template-type-parameter name="KeyTypeKeyCompare"/>
  3791. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3792. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3793. <method name="upper_bound"><type>iterator</type><template>
  3794. <template-type-parameter name="KeyType"/>
  3795. <template-type-parameter name="KeyTypeKeyCompare"/>
  3796. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3797. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3798. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  3799. <template-type-parameter name="KeyType"/>
  3800. <template-type-parameter name="KeyTypeKeyCompare"/>
  3801. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3802. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3803. <method name="find"><type>iterator</type><template>
  3804. <template-type-parameter name="KeyType"/>
  3805. <template-type-parameter name="KeyTypeKeyCompare"/>
  3806. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3807. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3808. <method name="find" cv="const"><type>const_iterator</type><template>
  3809. <template-type-parameter name="KeyType"/>
  3810. <template-type-parameter name="KeyTypeKeyCompare"/>
  3811. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3812. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3813. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  3814. <template-type-parameter name="KeyType"/>
  3815. <template-type-parameter name="KeyTypeKeyCompare"/>
  3816. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3817. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  3818. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  3819. <template-type-parameter name="KeyType"/>
  3820. <template-type-parameter name="KeyTypeKeyCompare"/>
  3821. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  3822. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3823. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  3824. <template-type-parameter name="KeyType"/>
  3825. <template-type-parameter name="KeyTypeKeyCompare"/>
  3826. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3827. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3828. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  3829. <template-type-parameter name="KeyType"/>
  3830. <template-type-parameter name="KeyTypeKeyCompare"/>
  3831. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  3832. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3833. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3834. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  3835. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  3836. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  3837. <method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  3838. <method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  3839. <method name="balance_factor" cv="const"><type>float</type><description><para><emphasis role="bold">Returns</emphasis>: The balance factor (alpha) used in this tree</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3840. <method name="balance_factor"><type>void</type><parameter name="new_alpha"><paramtype>float</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_alpha must be a value between 0.5 and 1.0</para><para><emphasis role="bold">Effects</emphasis>: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  3841. </method-group>
  3842. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3843. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3844. <constructor><template>
  3845. <template-type-parameter name="Iterator"/>
  3846. </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  3847. <constructor><parameter name="x"><paramtype><classname>sgtree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  3848. <copy-assignment><type><classname>sgtree</classname> &amp;</type><parameter name="x"><paramtype><classname>sgtree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  3849. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  3850. <method-group name="public static functions">
  3851. <method name="container_from_end_iterator" specifiers="static"><type><classname>sgtree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3852. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>sgtree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  3853. <method name="container_from_iterator" specifiers="static"><type><classname>sgtree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  3854. <method name="container_from_iterator" specifiers="static"><type>const <classname>sgtree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  3855. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  3856. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  3857. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  3858. </method-group>
  3859. </class>
  3860. </namespace>
  3861. </namespace>
  3862. </header>
  3863. <header name="boost/intrusive/sgtree_algorithms.hpp">
  3864. <namespace name="boost">
  3865. <namespace name="intrusive">
  3866. <class name="sgtree_algorithms"><template>
  3867. <template-type-parameter name="NodeTraits"/>
  3868. </template><description><para><classname alt="boost::intrusive::sgtree_algorithms">sgtree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput> </para></description><struct name="insert_commit_data"><inherit access="public">insert_commit_data</inherit><description><para>This type is the information that will be filled by insert_unique_check </para></description><data-member name="depth"><type>std::size_t</type></data-member>
  3869. </struct><typedef name="node"><type>NodeTraits::node</type></typedef>
  3870. <typedef name="node_traits"><type>NodeTraits</type></typedef>
  3871. <typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
  3872. <typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
  3873. <method-group name="public static functions">
  3874. <method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3875. <method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3876. <method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3877. <method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3878. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  3879. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  3880. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
  3881. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
  3882. <method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><purpose>static void unlink(node_ptr node); </purpose><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
  3883. <method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3884. <method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3885. <method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3886. <method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3887. <method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  3888. <method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  3889. <method name="erase" specifiers="static"><type>node_ptr</type><template>
  3890. <template-type-parameter name="AlphaByMaxSize"/>
  3891. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="alpha_by_maxsize"><paramtype>AlphaByMaxSize</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3892. <method name="clone" specifiers="static"><type>void</type><template>
  3893. <template-type-parameter name="Cloner"/>
  3894. <template-type-parameter name="Disposer"/>
  3895. </template><parameter name="source_header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  3896. <method name="clear_and_dispose" specifiers="static"><type>void</type><template>
  3897. <template-type-parameter name="Disposer"/>
  3898. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  3899. <method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
  3900. <template-type-parameter name="KeyType"/>
  3901. <template-type-parameter name="KeyNodePtrCompare"/>
  3902. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  3903. <method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
  3904. <template-type-parameter name="KeyType"/>
  3905. <template-type-parameter name="KeyNodePtrCompare"/>
  3906. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  3907. <method name="find" specifiers="static"><type>node_ptr</type><template>
  3908. <template-type-parameter name="KeyType"/>
  3909. <template-type-parameter name="KeyNodePtrCompare"/>
  3910. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  3911. <method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  3912. <template-type-parameter name="KeyType"/>
  3913. <template-type-parameter name="KeyNodePtrCompare"/>
  3914. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  3915. <method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  3916. <template-type-parameter name="KeyType"/>
  3917. <template-type-parameter name="KeyNodePtrCompare"/>
  3918. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
  3919. <method name="count" specifiers="static"><type>std::size_t</type><template>
  3920. <template-type-parameter name="KeyType"/>
  3921. <template-type-parameter name="KeyNodePtrCompare"/>
  3922. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  3923. <method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
  3924. <template-type-parameter name="NodePtrCompare"/>
  3925. <template-type-parameter name="H_Alpha"/>
  3926. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  3927. <method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
  3928. <template-type-parameter name="NodePtrCompare"/>
  3929. <template-type-parameter name="H_Alpha"/>
  3930. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  3931. <method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
  3932. <template-type-parameter name="NodePtrCompare"/>
  3933. <template-type-parameter name="H_Alpha"/>
  3934. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  3935. <method name="insert_before" specifiers="static"><type>node_ptr</type><template>
  3936. <template-type-parameter name="H_Alpha"/>
  3937. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
  3938. <method name="push_back" specifiers="static"><type>void</type><template>
  3939. <template-type-parameter name="H_Alpha"/>
  3940. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  3941. <method name="push_front" specifiers="static"><type>void</type><template>
  3942. <template-type-parameter name="H_Alpha"/>
  3943. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  3944. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  3945. <template-type-parameter name="KeyType"/>
  3946. <template-type-parameter name="KeyNodePtrCompare"/>
  3947. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype><classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  3948. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  3949. <template-type-parameter name="KeyType"/>
  3950. <template-type-parameter name="KeyNodePtrCompare"/>
  3951. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype><classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  3952. <method name="insert_unique_commit" specifiers="static"><type>void</type><template>
  3953. <template-type-parameter name="H_Alpha"/>
  3954. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const <classname>insert_commit_data</classname> &amp;</paramtype></parameter><parameter name="tree_size"><paramtype>std::size_t</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="max_tree_size"><paramtype>std::size_t &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  3955. <method name="transfer_unique" specifiers="static"><type>bool</type><template>
  3956. <template-type-parameter name="NodePtrCompare"/>
  3957. <template-type-parameter name="H_Alpha"/>
  3958. <template-type-parameter name="AlphaByMaxSize"/>
  3959. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree1_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree1_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="tree2_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree2_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="alpha_by_maxsize"><paramtype>AlphaByMaxSize</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  3960. <method name="transfer_equal" specifiers="static"><type>void</type><template>
  3961. <template-type-parameter name="NodePtrCompare"/>
  3962. <template-type-parameter name="H_Alpha"/>
  3963. <template-type-parameter name="AlphaByMaxSize"/>
  3964. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="tree1_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree1_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="tree2_size"><paramtype>std::size_t</paramtype></parameter><parameter name="max_tree2_size"><paramtype>std::size_t &amp;</paramtype></parameter><parameter name="h_alpha"><paramtype>H_Alpha</paramtype></parameter><parameter name="alpha_by_maxsize"><paramtype>AlphaByMaxSize</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  3965. <method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3966. <method name="rebalance" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  3967. </method-group>
  3968. </class>
  3969. </namespace>
  3970. </namespace>
  3971. </header>
  3972. <header name="boost/intrusive/slist.hpp">
  3973. <namespace name="boost">
  3974. <namespace name="intrusive">
  3975. <struct name="make_slist"><template>
  3976. <template-type-parameter name="T"/>
  3977. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3978. </template><description><para>Helper metafunction to define a <computeroutput>slist</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  3979. </struct><class name="slist"><template>
  3980. <template-type-parameter name="T"/>
  3981. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  3982. </template><description><para>The class template slist is an intrusive container, that encapsulates a singly-linked list. You can use such a list to squeeze the last bit of performance from your application. Unfortunately, the little gains come with some huge drawbacks. A lot of member functions can't be implemented as efficiently as for standard containers. To overcome this limitation some other member functions with rather unusual semantics have to be introduced.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>linear&lt;&gt;</computeroutput> and <computeroutput>cache_last&lt;&gt;</computeroutput>.</para><para>The iterators of slist are forward iterators. slist provides a static function called "previous" to compute the previous iterator of a given iterator. This function has linear complexity. To improve the usability esp. with the '*_after' functions, ++end() == begin() and previous(begin()) == end() are defined. An new special function "before_begin()" is defined, which returns an iterator that points one less the beginning of the list: ++before_begin() == begin() </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
  3983. <typedef name="pointer"><type>value_traits::pointer</type></typedef>
  3984. <typedef name="const_pointer"><type>value_traits::const_pointer</type></typedef>
  3985. <typedef name="value_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::element_type</type></typedef>
  3986. <typedef name="reference"><type><classname>pointer_traits</classname>&lt; pointer &gt;::reference</type></typedef>
  3987. <typedef name="const_reference"><type><classname>pointer_traits</classname>&lt; const_pointer &gt;::reference</type></typedef>
  3988. <typedef name="difference_type"><type><classname>pointer_traits</classname>&lt; pointer &gt;::difference_type</type></typedef>
  3989. <typedef name="size_type"><type>SizeType</type></typedef>
  3990. <typedef name="iterator"><type>slist_iterator&lt; value_traits, false &gt;</type></typedef>
  3991. <typedef name="const_iterator"><type>slist_iterator&lt; value_traits, true &gt;</type></typedef>
  3992. <typedef name="node_traits"><type>value_traits::node_traits</type></typedef>
  3993. <typedef name="node"><type>node_traits::node</type></typedef>
  3994. <typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
  3995. <typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
  3996. <typedef name="header_holder_type"><type><emphasis>unspecified</emphasis></type></typedef>
  3997. <typedef name="node_algorithms"><type><emphasis>unspecified</emphasis></type></typedef>
  3998. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  3999. <data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
  4000. <data-member name="linear" specifiers="static"><type>const bool</type></data-member>
  4001. <data-member name="cache_last" specifiers="static"><type>const bool</type></data-member>
  4002. <data-member name="has_container_from_iterator" specifiers="static"><type>const bool</type></data-member>
  4003. <method-group name="public member functions">
  4004. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements of the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of the list. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  4005. <method name="clear_and_dispose"><type>void</type><template>
  4006. <template-type-parameter name="Disposer"/>
  4007. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements of the container Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of the list.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4008. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the front of the list. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  4009. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the back of the list. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. This function is only available is cache_last&lt;&gt; is true. </para></description></method>
  4010. <method name="pop_front"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases the first element of the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  4011. <method name="pop_front_and_dispose"><type>void</type><template>
  4012. <template-type-parameter name="Disposer"/>
  4013. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the first element of the list. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
  4014. <method name="front"><type>reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reference to the first element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4015. <method name="front" cv="const"><type>const_reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reference to the first element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4016. <method name="back"><type>reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reference to the last element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. This function is only available is cache_last&lt;&gt; is true. </para></description></method>
  4017. <method name="back" cv="const"><type>const_reference</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reference to the last element of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. This function is only available is cache_last&lt;&gt; is true. </para></description></method>
  4018. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4019. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4020. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the first element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4021. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4022. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4023. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the end of the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4024. <method name="before_begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator that points to a position before the first element. Equivalent to "end()"</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4025. <method name="before_begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator that points to a position before the first element. Equivalent to "end()"</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4026. <method name="cbefore_begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator that points to a position before the first element. Equivalent to "end()"</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4027. <method name="last"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the last element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: This function is present only if cached_last&lt;&gt; option is true. </para></description></method>
  4028. <method name="last" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the last element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: This function is present only if cached_last&lt;&gt; option is true. </para></description></method>
  4029. <method name="clast" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator to the last element contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: This function is present only if cached_last&lt;&gt; option is true. </para></description></method>
  4030. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of the elements contained in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements contained in the list. if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is false. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  4031. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the list contains no elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  4032. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the elements of x and *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements of both lists. Constant-time if linear&lt;&gt; and/or cache_last&lt;&gt; options are used.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  4033. <method name="shift_backwards"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><default>1</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves backwards all the elements, so that the first element becomes the second, the second becomes the third... the last element becomes the first one.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number shifts.</para><para><emphasis role="bold">Note</emphasis>: Iterators Does not affect the validity of iterators and references. </para></description></method>
  4034. <method name="shift_forward"><type>void</type><parameter name="n"><paramtype>size_type</paramtype><default>1</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Moves forward all the elements, so that the second element becomes the first, the third becomes the second... the first element becomes the last one.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements plus the number shifts.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  4035. <method name="clone_from"><type>void</type><template>
  4036. <template-type-parameter name="Cloner"/>
  4037. <template-type-parameter name="Disposer"/>
  4038. </template><parameter name="src"><paramtype>const <classname>slist</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws. </para></description></method>
  4039. <method name="clone_from"><type>void</type><template>
  4040. <template-type-parameter name="Cloner"/>
  4041. <template-type-parameter name="Disposer"/>
  4042. </template><parameter name="src"><paramtype><classname>slist</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws. </para></description></method>
  4043. <method name="insert_after"><type>iterator</type><parameter name="prev_p"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and prev_p must point to an element contained by the list or to end().</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value after the position pointed by prev_p. No copy constructor is called.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the inserted element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  4044. <method name="insert_after"><type>void</type><template>
  4045. <template-type-parameter name="Iterator"/>
  4046. </template><parameter name="prev_p"><paramtype>const_iterator</paramtype></parameter><parameter name="f"><paramtype>Iterator</paramtype></parameter><parameter name="l"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type and prev_p must point to an element contained by the list or to the end node.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the [f, l) after the position prev_p.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  4047. <method name="insert"><type>iterator</type><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and p must point to an element contained by the list or to end().</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value before the position pointed by p. No copy constructor is called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before p. Constant-time if cache_last&lt;&gt; is true and p == end().</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  4048. <method name="insert"><type>void</type><template>
  4049. <template-type-parameter name="Iterator"/>
  4050. </template><parameter name="p"><paramtype>const_iterator</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type and p must point to an element contained by the list or to the end node.</para><para><emphasis role="bold">Effects</emphasis>: Inserts the pointed by b and e before the position p. No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements before b. Linear to the number of elements to insert if cache_last&lt;&gt; option is true and p == end().</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. </para></description></method>
  4051. <method name="erase_after"><type>iterator</type><parameter name="prev"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element after the element pointed by prev of the list. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  4052. <method name="erase_after"><type>iterator</type><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range (before_f, l) from the list. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of erased elements if it's a safe-mode , auto-unlink value or constant-time size is activated. Constant time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  4053. <method name="erase_after"><type>iterator</type><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range (before_f, l) from the list. n must be distance(before_f, l) - 1. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: constant-time if <classname alt="boost::intrusive::link_mode">link_mode</classname> is normal_link. Linear to the elements (l - before_f) otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  4054. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed by i of the list. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed element, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements before i.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  4055. <method name="erase"><type>iterator</type><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: f and l must be valid iterator to elements in *this.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed by b and e. No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements before l.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  4056. <method name="erase"><type>iterator</type><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range [f, l) from the list. n must be distance(f, l). No destructors are called.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: linear to the elements before f if <classname alt="boost::intrusive::link_mode">link_mode</classname> is normal_link and <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is activated. Linear to the elements before l otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  4057. <method name="erase_after_and_dispose"><type>iterator</type><template>
  4058. <template-type-parameter name="Disposer"/>
  4059. </template><parameter name="prev"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element after the element pointed by prev of the list. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
  4060. <method name="erase_after_and_dispose"><type>iterator</type><template>
  4061. <template-type-parameter name="Disposer"/>
  4062. </template><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range (before_f, l) from the list. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements (l - before_f + 1).</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased element. </para></description></method>
  4063. <method name="erase_and_dispose"><type>iterator</type><template>
  4064. <template-type-parameter name="Disposer"/>
  4065. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed by i of the list. No destructors are called. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed element, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements before i.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. </para></description></method>
  4066. <method name="erase_and_dispose"><type>iterator</type><template>
  4067. <template-type-parameter name="Disposer"/>
  4068. </template><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: f and l must be valid iterator to elements in *this. Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed by b and e. No destructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: the first element remaining beyond the removed elements, or end() if no such element exists.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of erased elements plus linear to the elements before f.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  4069. <method name="assign"><type>void</type><template>
  4070. <template-type-parameter name="Iterator"/>
  4071. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements contained in the list if it's a safe-mode or auto-unlink value. Linear to the number of elements inserted in the list otherwise.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  4072. <method name="dispose_and_assign"><type>void</type><template>
  4073. <template-type-parameter name="Iterator"/>
  4074. <template-type-parameter name="Disposer"/>
  4075. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Clears the list and inserts the range pointed by b and e. No destructors or copy constructors are called. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements inserted plus linear to the elements contained in the list.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. </para></description></method>
  4076. <method name="splice_after"><type>void</type><parameter name="prev"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="l"><paramtype>const_iterator *</paramtype><default>0</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev must point to an element contained by this list or to the before_begin() element</para><para><emphasis role="bold">Effects</emphasis>: Transfers all the elements of list x to this list, after the the element pointed by prev. No destructors or copy constructors are called.</para><para><emphasis role="bold">Returns</emphasis>: Nothing.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: In general, linear to the elements contained in x. Constant-time if cache_last&lt;&gt; option is true and also constant-time if linear&lt;&gt; option is true "this" is empty and "l" is not used.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.</para><para><emphasis role="bold">Additional note</emphasis>: If the optional parameter "l" is provided, it will be assigned to the last spliced element or prev if x is empty. This iterator can be used as new "prev" iterator for a new splice_after call. that will splice new values after the previously spliced values. </para></description></method>
  4077. <method name="splice_after"><type>void</type><parameter name="prev_pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="prev_ele"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev must point to an element contained by this list or to the before_begin() element. prev_ele must point to an element contained in list x or must be x.before_begin().</para><para><emphasis role="bold">Effects</emphasis>: Transfers the element after prev_ele, from list x to this list, after the element pointed by prev. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  4078. <method name="splice_after"><type>void</type><parameter name="prev_pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="before_l"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_pos must be a dereferenceable iterator in *this or be before_begin(), and before_f and before_l belong to x and ++before_f != x.end() &amp;&amp; before_l != x.end().</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range (before_f, before_l] from list x to this list, after the element pointed by prev_pos. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements transferred if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is true. Constant-time otherwise.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  4079. <method name="splice_after"><type>void</type><parameter name="prev_pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="before_f"><paramtype>const_iterator</paramtype></parameter><parameter name="before_l"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: prev_pos must be a dereferenceable iterator in *this or be before_begin(), and before_f and before_l belong to x and ++before_f != x.end() &amp;&amp; before_l != x.end() and n == distance(before_f, before_l).</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range (before_f, before_l] from list x to this list, after the element pointed by p. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  4080. <method name="splice"><type>void</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="l"><paramtype>const_iterator *</paramtype><default>0</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: it is an iterator to an element in *this.</para><para><emphasis role="bold">Effects</emphasis>: Transfers all the elements of list x to this list, before the the element pointed by it. No destructors or copy constructors are called.</para><para><emphasis role="bold">Returns</emphasis>: Nothing.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements contained in x plus linear to the elements before it. Linear to the elements before it if cache_last&lt;&gt; option is true. Constant-time if cache_last&lt;&gt; option is true and it == end().</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated.</para><para><emphasis role="bold">Additional note</emphasis>: If the optional parameter "l" is provided, it will be assigned to the last spliced element or prev if x is empty. This iterator can be used as new "prev" iterator for a new splice_after call. that will splice new values after the previously spliced values. </para></description></method>
  4081. <method name="splice"><type>void</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="elem"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: it p must be a valid iterator of *this. elem must point to an element contained in list x.</para><para><emphasis role="bold">Effects</emphasis>: Transfers the element elem, from list x to this list, before the element pointed by pos. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements before pos and before elem. Linear to the elements before elem if cache_last&lt;&gt; option is true and pos == end().</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  4082. <method name="splice"><type>void</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: pos must be a dereferenceable iterator in *this and f and f belong to x and f and f a valid range on x.</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range [f, l) from list x to this list, before the element pointed by pos. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the sum of elements before pos, f, and l plus linear to the number of elements transferred if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is true. Linear to the sum of elements before f, and l plus linear to the number of elements transferred if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is true if cache_last&lt;&gt; is true and pos == end()</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  4083. <method name="splice"><type>void</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="f"><paramtype>const_iterator</paramtype></parameter><parameter name="l"><paramtype>const_iterator</paramtype></parameter><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: pos must be a dereferenceable iterator in *this and f and l belong to x and f and l a valid range on x. n == distance(f, l).</para><para><emphasis role="bold">Effects</emphasis>: Transfers the range [f, l) from list x to this list, before the element pointed by pos. No destructors or copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the sum of elements before pos, f, and l. Linear to the sum of elements before f and l if cache_last&lt;&gt; is true and pos == end().</para><para><emphasis role="bold">Note</emphasis>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </para></description></method>
  4084. <method name="sort"><type>void</type><template>
  4085. <template-type-parameter name="Predicate"/>
  4086. </template><parameter name="p"><paramtype>Predicate</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: This function sorts the list *this according to std::less&lt;value_type&gt;. The sort is stable, that is, the relative order of equivalent elements is preserved.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: The number of comparisons is approximately N log N, where N is the list's size.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
  4087. <method name="sort"><type>void</type><description><para><emphasis role="bold">Requires</emphasis>: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.</para><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or std::less&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
  4088. <method name="merge"><type>void</type><template>
  4089. <template-type-parameter name="Predicate"/>
  4090. </template><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="p"><paramtype>Predicate</paramtype></parameter><parameter name="l"><paramtype>const_iterator *</paramtype><default>0</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.</para><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Returns</emphasis>: Nothing.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated.</para><para><emphasis role="bold">Additional note</emphasis>: If optional "l" argument is passed, it is assigned to an iterator to the last transferred value or end() is x is empty. </para></description></method>
  4091. <method name="merge"><type>void</type><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: This function removes all of x's elements and inserts them in order into *this according to std::less&lt;value_type&gt;. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</para><para><emphasis role="bold">Throws</emphasis>: if std::less&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
  4092. <method name="reverse"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Reverses the order of elements in the list.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: This function is linear to the contained elements.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated </para></description></method>
  4093. <method name="remove"><type>void</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes all the elements that compare equal to value. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. This function is linear time: it performs exactly size() comparisons for equality. </para></description></method>
  4094. <method name="remove_and_dispose"><type>void</type><template>
  4095. <template-type-parameter name="Disposer"/>
  4096. </template><parameter name="value"><paramtype>const_reference</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes all the elements that compare equal to value. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  4097. <method name="remove_if"><type>void</type><template>
  4098. <template-type-parameter name="Pred"/>
  4099. </template><parameter name="pred"><paramtype>Pred</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes all the elements for which a specified predicate is satisfied. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() calls to the predicate.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  4100. <method name="remove_and_dispose_if"><type>void</type><template>
  4101. <template-type-parameter name="Pred"/>
  4102. <template-type-parameter name="Disposer"/>
  4103. </template><parameter name="pred"><paramtype>Pred</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes all the elements for which a specified predicate is satisfied. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If pred throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time. It performs exactly size() comparisons for equality.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  4104. <method name="unique"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that are equal from the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons calls to pred()).</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  4105. <method name="unique"><type>void</type><template>
  4106. <template-type-parameter name="BinaryPredicate"/>
  4107. </template><parameter name="pred"><paramtype>BinaryPredicate</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. No destructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  4108. <method name="unique_and_dispose"><type>void</type><template>
  4109. <template-type-parameter name="Disposer"/>
  4110. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If std::equal_to&lt;value_type&gt; throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  4111. <method name="unique_and_dispose"><type>void</type><template>
  4112. <template-type-parameter name="BinaryPredicate"/>
  4113. <template-type-parameter name="Disposer"/>
  4114. </template><parameter name="pred"><paramtype>BinaryPredicate</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list. Disposer::operator()(pointer) is called for every removed element.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. Basic guarantee.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time (size()-1) comparisons equality comparisons.</para><para><emphasis role="bold">Note</emphasis>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </para></description></method>
  4115. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns a const_iterator pointing to the element</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
  4116. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a const reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns an iterator pointing to the element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. </para></description></method>
  4117. <method name="previous"><type>iterator</type><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: The iterator to the element before i in the list. Returns the end-iterator, if either i is the begin-iterator or the list is empty.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before i. Constant if cache_last&lt;&gt; is true and i == end(). </para></description></method>
  4118. <method name="previous" cv="const"><type>const_iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: The const_iterator to the element before i in the list. Returns the end-const_iterator, if either i is the begin-const_iterator or the list is empty.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before i. Constant if cache_last&lt;&gt; is true and i == end(). </para></description></method>
  4119. <method name="previous"><type>iterator</type><parameter name="prev_from"><paramtype>const_iterator</paramtype></parameter><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: The iterator to the element before i in the list, starting the search on element after prev_from. Returns the end-iterator, if either i is the begin-iterator or the list is empty.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before i. Constant if cache_last&lt;&gt; is true and i == end(). </para></description></method>
  4120. <method name="previous" cv="const"><type>const_iterator</type><parameter name="prev_from"><paramtype>const_iterator</paramtype></parameter><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Returns</emphasis>: The const_iterator to the element before i in the list, starting the search on element after prev_from. Returns the end-const_iterator, if either i is the begin-const_iterator or the list is empty.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements before i. Constant if cache_last&lt;&gt; is true and i == end(). </para></description></method>
  4121. <method name="check" cv="const"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
  4122. </method-group>
  4123. <constructor><description><para><emphasis role="bold">Effects</emphasis>: constructs an empty list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
  4124. <constructor specifiers="explicit"><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: constructs an empty list.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
  4125. <constructor><template>
  4126. <template-type-parameter name="Iterator"/>
  4127. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs a list equal to [b ,e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in distance(b, e). No copy constructors are called.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks). </para></description></constructor>
  4128. <constructor><parameter name="x"><paramtype><classname>slist</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of value traits throws. </para></description></constructor>
  4129. <copy-assignment><type><classname>slist</classname> &amp;</type><parameter name="x"><paramtype><classname>slist</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  4130. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If it's a safe-mode or auto-unlink value, the destructor does nothing (ie. no code is generated). Otherwise it detaches all elements from this. In this case the objects in the list are not deleted (i.e. no destructors are called), but the hooks according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are set to their default value.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the list, if it's a safe-mode or auto-unlink value. Otherwise constant. </para></description></destructor>
  4131. <method-group name="public static functions">
  4132. <method name="container_from_end_iterator" specifiers="static"><type><classname>slist</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of slist.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the slist associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4133. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>slist</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end const_iterator of slist.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the slist associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4134. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns a const_iterator pointing to the element</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  4135. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be a const reference to a value inserted in a list.</para><para><emphasis role="bold">Effects</emphasis>: This function returns an iterator pointing to the element.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: Iterators and references are not invalidated. This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  4136. </method-group>
  4137. <method-group name="private member functions">
  4138. <method name="priv_splice_after"><type>void</type><parameter name="prev_pos_n"><paramtype>node_ptr</paramtype></parameter><parameter name="x"><paramtype><classname>slist</classname> &amp;</paramtype></parameter><parameter name="before_f_n"><paramtype>node_ptr</paramtype></parameter><parameter name="before_l_n"><paramtype>node_ptr</paramtype></parameter></method>
  4139. <method name="priv_incorporate_after"><type>void</type><parameter name="prev_pos_n"><paramtype>node_ptr</paramtype></parameter><parameter name="first_n"><paramtype>node_ptr</paramtype></parameter><parameter name="before_l_n"><paramtype>node_ptr</paramtype></parameter></method>
  4140. <method name="priv_reverse"><type>void</type><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
  4141. <method name="priv_reverse"><type>void</type><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
  4142. <method name="priv_shift_backwards"><type>void</type><parameter name="n"><paramtype>size_type</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
  4143. <method name="priv_shift_backwards"><type>void</type><parameter name="n"><paramtype>size_type</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
  4144. <method name="priv_shift_forward"><type>void</type><parameter name="n"><paramtype>size_type</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
  4145. <method name="priv_shift_forward"><type>void</type><parameter name="n"><paramtype>size_type</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
  4146. </method-group>
  4147. <method-group name="private static functions">
  4148. <method name="priv_swap_cache_last" specifiers="static"><type>void</type><parameter name="this_impl"><paramtype><classname>slist</classname> *</paramtype></parameter><parameter name="other_impl"><paramtype><classname>slist</classname> *</paramtype></parameter></method>
  4149. <method name="priv_swap_lists" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
  4150. <method name="priv_swap_lists" specifiers="static"><type>void</type><parameter name="this_node"><paramtype>node_ptr</paramtype></parameter><parameter name="other_node"><paramtype>node_ptr</paramtype></parameter><parameter name=""><paramtype><emphasis>unspecified</emphasis></paramtype></parameter></method>
  4151. <method name="priv_container_from_end_iterator" specifiers="static"><type><classname>slist</classname> &amp;</type><parameter name="end_iterator"><paramtype>const const_iterator &amp;</paramtype></parameter></method>
  4152. </method-group>
  4153. </class>
  4154. </namespace>
  4155. </namespace>
  4156. </header>
  4157. <header name="boost/intrusive/slist_hook.hpp">
  4158. <namespace name="boost">
  4159. <namespace name="intrusive">
  4160. <struct name="make_slist_base_hook"><template>
  4161. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4162. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::slist_base_hook">slist_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  4163. </struct><struct name="make_slist_member_hook"><template>
  4164. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4165. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::slist_member_hook">slist_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  4166. </struct><class name="slist_base_hook"><template>
  4167. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4168. </template><inherit access="public">make_slist_base_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::slist_base_hook">slist_base_hook</classname> in order to store objects in in an list. <classname alt="boost::intrusive::slist_base_hook">slist_base_hook</classname> holds the data necessary to maintain the list and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for list.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
  4169. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>slist_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4170. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>slist::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  4171. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4172. </method-group>
  4173. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  4174. <constructor><parameter name=""><paramtype>const <classname>slist_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  4175. <copy-assignment><type><classname>slist_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>slist_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  4176. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an slist an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  4177. </class><class name="slist_member_hook"><template>
  4178. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4179. </template><inherit access="public">make_slist_member_hook::type&lt; O1, O2, O3 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::slist_member_hook">slist_member_hook</classname> in order to store objects of this class in an list. <classname alt="boost::intrusive::slist_member_hook">slist_member_hook</classname> holds the data necessary for maintaining the list and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for list.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput> and <computeroutput>link_mode&lt;&gt;</computeroutput>.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook. </para></description><method-group name="public member functions">
  4180. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>slist_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4181. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>slist::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Note</emphasis>: If this member is called when the value is inserted in a slist with the option linear&lt;true&gt;, this function will return "false" for the last element, as it is not linked to anything (the next element is null), so use with care.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  4182. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4183. </method-group>
  4184. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  4185. <constructor><parameter name=""><paramtype>const <classname>slist_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  4186. <copy-assignment><type><classname>slist_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>slist_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  4187. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an slist an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  4188. </class>
  4189. </namespace>
  4190. </namespace>
  4191. </header>
  4192. <header name="boost/intrusive/splay_set.hpp">
  4193. <namespace name="boost">
  4194. <namespace name="intrusive">
  4195. <struct name="make_splay_multiset"><template>
  4196. <template-type-parameter name="T"/>
  4197. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4198. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::splay_multiset">splay_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  4199. </struct><struct name="make_splay_set"><template>
  4200. <template-type-parameter name="T"/>
  4201. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4202. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::splay_set">splay_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  4203. </struct><class name="splay_multiset"><template>
  4204. <template-type-parameter name="T"/>
  4205. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4206. </template><description><para>The class template <classname alt="boost::intrusive::splay_multiset">splay_multiset</classname> is an intrusive container, that mimics most of the interface of std::multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  4207. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  4208. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  4209. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  4210. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  4211. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  4212. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  4213. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  4214. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  4215. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  4216. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  4217. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  4218. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  4219. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  4220. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  4221. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  4222. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  4223. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  4224. <typedef name="node"><type>implementation_defined::node</type></typedef>
  4225. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  4226. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  4227. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  4228. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  4229. <method-group name="public member functions">
  4230. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4231. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4232. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4233. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4234. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4235. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4236. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4237. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4238. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4239. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4240. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4241. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4242. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4243. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4244. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4245. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  4246. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  4247. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4248. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4249. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>splay_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  4250. <method name="clone_from"><type>void</type><template>
  4251. <template-type-parameter name="Cloner"/>
  4252. <template-type-parameter name="Disposer"/>
  4253. </template><parameter name="src"><paramtype>const <classname>splay_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
  4254. <method name="clone_from"><type>void</type><template>
  4255. <template-type-parameter name="Cloner"/>
  4256. <template-type-parameter name="Disposer"/>
  4257. </template><parameter name="src"><paramtype><classname>splay_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  4258. <method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4259. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4260. <method name="insert"><type>void</type><template>
  4261. <template-type-parameter name="Iterator"/>
  4262. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4263. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  4264. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  4265. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  4266. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4267. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4268. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4269. <method name="erase"><type>size_type</type><template>
  4270. <template-type-parameter name="KeyType"/>
  4271. <template-type-parameter name="KeyTypeKeyCompare"/>
  4272. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4273. <method name="erase_and_dispose"><type>iterator</type><template>
  4274. <template-type-parameter name="Disposer"/>
  4275. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4276. <method name="erase_and_dispose"><type>iterator</type><template>
  4277. <template-type-parameter name="Disposer"/>
  4278. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4279. <method name="erase_and_dispose"><type>size_type</type><template>
  4280. <template-type-parameter name="Disposer"/>
  4281. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4282. <method name="erase_and_dispose"><type>size_type</type><template>
  4283. <template-type-parameter name="KeyType"/>
  4284. <template-type-parameter name="KeyTypeKeyCompare"/>
  4285. <template-type-parameter name="Disposer"/>
  4286. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4287. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4288. <method name="clear_and_dispose"><type>void</type><template>
  4289. <template-type-parameter name="Disposer"/>
  4290. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  4291. <method name="count"><type>size_type</type><parameter name=""><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
  4292. <method name="count"><type>size_type</type><template>
  4293. <template-type-parameter name="KeyType"/>
  4294. <template-type-parameter name="KeyTypeKeyCompare"/>
  4295. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4296. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
  4297. <method name="lower_bound"><type>iterator</type><template>
  4298. <template-type-parameter name="KeyType"/>
  4299. <template-type-parameter name="KeyTypeKeyCompare"/>
  4300. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4301. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4302. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  4303. <template-type-parameter name="KeyType"/>
  4304. <template-type-parameter name="KeyTypeKeyCompare"/>
  4305. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4306. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
  4307. <method name="upper_bound"><type>iterator</type><template>
  4308. <template-type-parameter name="KeyType"/>
  4309. <template-type-parameter name="KeyTypeKeyCompare"/>
  4310. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4311. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4312. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  4313. <template-type-parameter name="KeyType"/>
  4314. <template-type-parameter name="KeyTypeKeyCompare"/>
  4315. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4316. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
  4317. <method name="find"><type>iterator</type><template>
  4318. <template-type-parameter name="KeyType"/>
  4319. <template-type-parameter name="KeyTypeKeyCompare"/>
  4320. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4321. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4322. <method name="find" cv="const"><type>const_iterator</type><template>
  4323. <template-type-parameter name="KeyType"/>
  4324. <template-type-parameter name="KeyTypeKeyCompare"/>
  4325. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4326. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
  4327. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  4328. <template-type-parameter name="KeyType"/>
  4329. <template-type-parameter name="KeyTypeKeyCompare"/>
  4330. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4331. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4332. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  4333. <template-type-parameter name="KeyType"/>
  4334. <template-type-parameter name="KeyTypeKeyCompare"/>
  4335. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4336. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_value"><paramtype>const_reference</paramtype></parameter><parameter name="upper_value"><paramtype>const_reference</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4337. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  4338. <template-type-parameter name="KeyType"/>
  4339. <template-type-parameter name="KeyTypeKeyCompare"/>
  4340. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4341. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_value"><paramtype>const_reference</paramtype></parameter><parameter name="upper_value"><paramtype>const_reference</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4342. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  4343. <template-type-parameter name="KeyType"/>
  4344. <template-type-parameter name="KeyTypeKeyCompare"/>
  4345. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4346. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4347. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4348. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  4349. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  4350. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  4351. <method name="splay_up"><type>void</type><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: i must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that the element pointed by i is placed as the root of the tree, improving future searches of this value.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4352. <method name="splay_down"><type>iterator</type><template>
  4353. <template-type-parameter name="KeyType"/>
  4354. <template-type-parameter name="KeyTypeKeyCompare"/>
  4355. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree. If the element is not present returns the last node compared with the key. If the tree is empty, end() is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor throws. </para></description></method>
  4356. <method name="splay_down"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. </para></description></method>
  4357. <method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  4358. <method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  4359. <method name="merge"><type>void</type><template>
  4360. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  4361. </template><parameter name="source"><paramtype><classname>splay_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  4362. <method name="merge"><type>void</type><template>
  4363. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  4364. </template><parameter name="source"><paramtype><classname>splay_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  4365. </method-group>
  4366. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  4367. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  4368. <constructor><template>
  4369. <template-type-parameter name="Iterator"/>
  4370. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  4371. <constructor><parameter name="x"><paramtype><classname>splay_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  4372. <copy-assignment><type><classname>splay_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>splay_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  4373. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  4374. <method-group name="public static functions">
  4375. <method name="container_from_end_iterator" specifiers="static"><type><classname>splay_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4376. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>splay_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4377. <method name="container_from_iterator" specifiers="static"><type><classname>splay_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  4378. <method name="container_from_iterator" specifiers="static"><type>const <classname>splay_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  4379. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  4380. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  4381. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  4382. </method-group>
  4383. </class><class name="splay_set"><template>
  4384. <template-type-parameter name="T"/>
  4385. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4386. </template><description><para>The class template <classname alt="boost::intrusive::splay_set">splay_set</classname> is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  4387. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  4388. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  4389. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  4390. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  4391. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  4392. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  4393. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  4394. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  4395. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  4396. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  4397. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  4398. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  4399. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  4400. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  4401. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  4402. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  4403. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  4404. <typedef name="node"><type>implementation_defined::node</type></typedef>
  4405. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  4406. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  4407. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  4408. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  4409. <method-group name="public member functions">
  4410. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4411. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4412. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4413. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4414. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4415. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4416. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4417. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4418. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4419. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4420. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4421. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4422. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4423. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4424. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4425. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  4426. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  4427. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4428. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4429. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>splay_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  4430. <method name="clone_from"><type>void</type><template>
  4431. <template-type-parameter name="Cloner"/>
  4432. <template-type-parameter name="Disposer"/>
  4433. </template><parameter name="src"><paramtype>const <classname>splay_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
  4434. <method name="clone_from"><type>void</type><template>
  4435. <template-type-parameter name="Cloner"/>
  4436. <template-type-parameter name="Disposer"/>
  4437. </template><parameter name="src"><paramtype><classname>splay_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  4438. <method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4439. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4440. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  4441. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  4442. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  4443. <template-type-parameter name="KeyType"/>
  4444. <template-type-parameter name="KeyTypeKeyCompare"/>
  4445. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  4446. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  4447. <template-type-parameter name="KeyType"/>
  4448. <template-type-parameter name="KeyTypeKeyCompare"/>
  4449. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  4450. <method name="insert"><type>void</type><template>
  4451. <template-type-parameter name="Iterator"/>
  4452. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4453. <method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  4454. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  4455. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  4456. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  4457. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4458. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4459. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4460. <method name="erase"><type>size_type</type><template>
  4461. <template-type-parameter name="KeyType"/>
  4462. <template-type-parameter name="KeyTypeKeyCompare"/>
  4463. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4464. <method name="erase_and_dispose"><type>iterator</type><template>
  4465. <template-type-parameter name="Disposer"/>
  4466. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4467. <method name="erase_and_dispose"><type>iterator</type><template>
  4468. <template-type-parameter name="Disposer"/>
  4469. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4470. <method name="erase_and_dispose"><type>size_type</type><template>
  4471. <template-type-parameter name="Disposer"/>
  4472. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4473. <method name="erase_and_dispose"><type>size_type</type><template>
  4474. <template-type-parameter name="KeyType"/>
  4475. <template-type-parameter name="KeyTypeKeyCompare"/>
  4476. <template-type-parameter name="Disposer"/>
  4477. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4478. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4479. <method name="clear_and_dispose"><type>void</type><template>
  4480. <template-type-parameter name="Disposer"/>
  4481. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  4482. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4483. <method name="count" cv="const"><type>size_type</type><template>
  4484. <template-type-parameter name="KeyType"/>
  4485. <template-type-parameter name="KeyTypeKeyCompare"/>
  4486. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4487. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4488. <method name="count" cv="const"><type>size_type</type><template>
  4489. <template-type-parameter name="KeyType"/>
  4490. <template-type-parameter name="KeyTypeKeyCompare"/>
  4491. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4492. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
  4493. <method name="lower_bound"><type>iterator</type><template>
  4494. <template-type-parameter name="KeyType"/>
  4495. <template-type-parameter name="KeyTypeKeyCompare"/>
  4496. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4497. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4498. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  4499. <template-type-parameter name="KeyType"/>
  4500. <template-type-parameter name="KeyTypeKeyCompare"/>
  4501. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4502. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
  4503. <method name="upper_bound"><type>iterator</type><template>
  4504. <template-type-parameter name="KeyType"/>
  4505. <template-type-parameter name="KeyTypeKeyCompare"/>
  4506. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4507. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4508. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  4509. <template-type-parameter name="KeyType"/>
  4510. <template-type-parameter name="KeyTypeKeyCompare"/>
  4511. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4512. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
  4513. <method name="find"><type>iterator</type><template>
  4514. <template-type-parameter name="KeyType"/>
  4515. <template-type-parameter name="KeyTypeKeyCompare"/>
  4516. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4517. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4518. <method name="find" cv="const"><type>const_iterator</type><template>
  4519. <template-type-parameter name="KeyType"/>
  4520. <template-type-parameter name="KeyTypeKeyCompare"/>
  4521. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4522. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  4523. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  4524. <template-type-parameter name="KeyType"/>
  4525. <template-type-parameter name="KeyTypeKeyCompare"/>
  4526. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  4527. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  4528. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  4529. <template-type-parameter name="KeyType"/>
  4530. <template-type-parameter name="KeyTypeKeyCompare"/>
  4531. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  4532. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4533. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  4534. <template-type-parameter name="KeyType"/>
  4535. <template-type-parameter name="KeyTypeKeyCompare"/>
  4536. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4537. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4538. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  4539. <template-type-parameter name="KeyType"/>
  4540. <template-type-parameter name="KeyTypeKeyCompare"/>
  4541. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4542. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4543. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4544. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  4545. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  4546. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  4547. <method name="splay_up"><type>void</type><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: i must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that the element pointed by i is placed as the root of the tree, improving future searches of this value.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4548. <method name="splay_down"><type>iterator</type><template>
  4549. <template-type-parameter name="KeyType"/>
  4550. <template-type-parameter name="KeyTypeKeyCompare"/>
  4551. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree. If the element is not present returns the last node compared with the key. If the tree is empty, end() is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor throws. </para></description></method>
  4552. <method name="splay_down"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. </para></description></method>
  4553. <method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  4554. <method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  4555. <method name="merge"><type>void</type><template>
  4556. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  4557. </template><parameter name="source"><paramtype><classname>splay_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  4558. <method name="merge"><type>void</type><template>
  4559. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  4560. </template><parameter name="source"><paramtype><classname>splay_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  4561. </method-group>
  4562. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  4563. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  4564. <constructor><template>
  4565. <template-type-parameter name="Iterator"/>
  4566. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  4567. <constructor><parameter name="x"><paramtype><classname>splay_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  4568. <copy-assignment><type><classname>splay_set</classname> &amp;</type><parameter name="x"><paramtype><classname>splay_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  4569. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  4570. <method-group name="public static functions">
  4571. <method name="container_from_end_iterator" specifiers="static"><type><classname>splay_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4572. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>splay_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4573. <method name="container_from_iterator" specifiers="static"><type><classname>splay_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  4574. <method name="container_from_iterator" specifiers="static"><type>const <classname>splay_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  4575. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  4576. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  4577. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  4578. </method-group>
  4579. </class><function name="operator!="><type>bool</type><template>
  4580. <template-type-parameter name="T"/>
  4581. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4582. </template><parameter name="x"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4583. <function name="operator&gt;"><type>bool</type><template>
  4584. <template-type-parameter name="T"/>
  4585. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4586. </template><parameter name="x"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4587. <function name="operator&lt;="><type>bool</type><template>
  4588. <template-type-parameter name="T"/>
  4589. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4590. </template><parameter name="x"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4591. <function name="operator&gt;="><type>bool</type><template>
  4592. <template-type-parameter name="T"/>
  4593. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4594. </template><parameter name="x"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4595. <function name="swap"><type>void</type><template>
  4596. <template-type-parameter name="T"/>
  4597. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4598. </template><parameter name="x"><paramtype><classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>splay_set</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4599. <function name="operator!="><type>bool</type><template>
  4600. <template-type-parameter name="T"/>
  4601. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4602. </template><parameter name="x"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4603. <function name="operator&gt;"><type>bool</type><template>
  4604. <template-type-parameter name="T"/>
  4605. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4606. </template><parameter name="x"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4607. <function name="operator&lt;="><type>bool</type><template>
  4608. <template-type-parameter name="T"/>
  4609. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4610. </template><parameter name="x"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4611. <function name="operator&gt;="><type>bool</type><template>
  4612. <template-type-parameter name="T"/>
  4613. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4614. </template><parameter name="x"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype>const <classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4615. <function name="swap"><type>void</type><template>
  4616. <template-type-parameter name="T"/>
  4617. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4618. </template><parameter name="x"><paramtype><classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter><parameter name="y"><paramtype><classname>splay_multiset</classname>&lt; T, Options... &gt; &amp;</paramtype></parameter></function>
  4619. </namespace>
  4620. </namespace>
  4621. </header>
  4622. <header name="boost/intrusive/splaytree.hpp">
  4623. <namespace name="boost">
  4624. <namespace name="intrusive">
  4625. <struct name="make_splaytree"><template>
  4626. <template-type-parameter name="T"/>
  4627. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4628. </template><description><para>Helper metafunction to define a <computeroutput>splaytree</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  4629. </struct><class name="splaytree"><template>
  4630. <template-type-parameter name="T"/>
  4631. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4632. </template><description><para>The class template splaytree is an intrusive splay tree container that is used to construct intrusive <classname alt="boost::intrusive::splay_set">splay_set</classname> and <classname alt="boost::intrusive::splay_multiset">splay_multiset</classname> containers. The no-throw guarantee holds only, if the key_compare object doesn't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput> and <computeroutput>compare&lt;&gt;</computeroutput>. </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
  4633. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  4634. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  4635. <typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  4636. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  4637. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  4638. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  4639. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  4640. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  4641. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  4642. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  4643. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  4644. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  4645. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  4646. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  4647. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  4648. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  4649. <typedef name="node"><type>implementation_defined::node</type></typedef>
  4650. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  4651. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  4652. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  4653. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  4654. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  4655. <method-group name="public member functions">
  4656. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4657. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4658. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4659. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4660. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4661. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4662. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4663. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4664. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4665. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4666. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4667. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4668. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4669. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4670. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4671. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  4672. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  4673. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4674. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4675. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>splaytree</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two containers.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  4676. <method name="clone_from"><type>void</type><template>
  4677. <template-type-parameter name="Cloner"/>
  4678. <template-type-parameter name="Disposer"/>
  4679. </template><parameter name="src"><paramtype>const <classname>splaytree</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. Additional notes: it also copies the alpha factor from the source container. </para></description></method>
  4680. <method name="clone_from"><type>void</type><template>
  4681. <template-type-parameter name="Cloner"/>
  4682. <template-type-parameter name="Disposer"/>
  4683. </template><parameter name="src"><paramtype><classname>splaytree</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: This version can modify the source container, useful to implement move semantics. </para></description></method>
  4684. <method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4685. <method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4686. <method name="insert_equal"><type>void</type><template>
  4687. <template-type-parameter name="Iterator"/>
  4688. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4689. <method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4690. <method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4691. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  4692. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee. </para></description></method>
  4693. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  4694. <template-type-parameter name="KeyType"/>
  4695. <template-type-parameter name="KeyTypeKeyCompare"/>
  4696. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  4697. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  4698. <template-type-parameter name="KeyType"/>
  4699. <template-type-parameter name="KeyTypeKeyCompare"/>
  4700. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. The difference is that comp compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp ordering function throws. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  4701. <method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the container using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  4702. <method name="insert_unique"><type>void</type><template>
  4703. <template-type-parameter name="Iterator"/>
  4704. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by value_comp().</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  4705. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  4706. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  4707. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  4708. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4709. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4710. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4711. <method name="erase"><type>size_type</type><template>
  4712. <template-type-parameter name="KeyType"/>
  4713. <template-type-parameter name="KeyTypeKeyCompare"/>
  4714. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4715. <method name="erase_and_dispose"><type>iterator</type><template>
  4716. <template-type-parameter name="Disposer"/>
  4717. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4718. <method name="erase_and_dispose"><type>iterator</type><template>
  4719. <template-type-parameter name="Disposer"/>
  4720. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4721. <method name="erase_and_dispose"><type>size_type</type><template>
  4722. <template-type-parameter name="Disposer"/>
  4723. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4724. <method name="erase_and_dispose"><type>size_type</type><template>
  4725. <template-type-parameter name="KeyType"/>
  4726. <template-type-parameter name="KeyTypeKeyCompare"/>
  4727. <template-type-parameter name="Disposer"/>
  4728. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk) and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  4729. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  4730. <method name="clear_and_dispose"><type>void</type><template>
  4731. <template-type-parameter name="Disposer"/>
  4732. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  4733. <method name="count"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
  4734. <method name="count"><type>size_type</type><template>
  4735. <template-type-parameter name="KeyType"/>
  4736. <template-type-parameter name="KeyTypeKeyCompare"/>
  4737. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
  4738. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4739. <method name="count" cv="const"><type>size_type</type><template>
  4740. <template-type-parameter name="KeyType"/>
  4741. <template-type-parameter name="KeyTypeKeyCompare"/>
  4742. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4743. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed. </para></description></method>
  4744. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4745. <method name="lower_bound"><type>iterator</type><template>
  4746. <template-type-parameter name="KeyType"/>
  4747. <template-type-parameter name="KeyTypeKeyCompare"/>
  4748. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4749. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  4750. <template-type-parameter name="KeyType"/>
  4751. <template-type-parameter name="KeyTypeKeyCompare"/>
  4752. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4753. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
  4754. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4755. <method name="upper_bound"><type>iterator</type><template>
  4756. <template-type-parameter name="KeyType"/>
  4757. <template-type-parameter name="KeyTypeKeyCompare"/>
  4758. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4759. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  4760. <template-type-parameter name="KeyType"/>
  4761. <template-type-parameter name="KeyTypeKeyCompare"/>
  4762. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4763. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
  4764. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4765. <method name="find"><type>iterator</type><template>
  4766. <template-type-parameter name="KeyType"/>
  4767. <template-type-parameter name="KeyTypeKeyCompare"/>
  4768. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4769. <method name="find" cv="const"><type>const_iterator</type><template>
  4770. <template-type-parameter name="KeyType"/>
  4771. <template-type-parameter name="KeyTypeKeyCompare"/>
  4772. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4773. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "value" </para></description></method>
  4774. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4775. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  4776. <template-type-parameter name="KeyType"/>
  4777. <template-type-parameter name="KeyTypeKeyCompare"/>
  4778. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: non-const function, splaying is performed for the first element of the equal range of "key" </para></description></method>
  4779. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  4780. <template-type-parameter name="KeyType"/>
  4781. <template-type-parameter name="KeyTypeKeyCompare"/>
  4782. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. Additional note: const function, no splaying is performed </para></description></method>
  4783. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4784. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  4785. <template-type-parameter name="KeyType"/>
  4786. <template-type-parameter name="KeyTypeKeyCompare"/>
  4787. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4788. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4789. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  4790. <template-type-parameter name="KeyType"/>
  4791. <template-type-parameter name="KeyTypeKeyCompare"/>
  4792. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  4793. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4794. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4795. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  4796. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  4797. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  4798. <method name="merge_unique"><type>void</type><template>
  4799. <template-type-parameter name="T"/>
  4800. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  4801. </template><parameter name=""><paramtype><classname>splaytree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  4802. <method name="merge_equal"><type>void</type><template>
  4803. <template-type-parameter name="T"/>
  4804. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  4805. </template><parameter name=""><paramtype><classname>splaytree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  4806. <method name="splay_up"><type>void</type><parameter name="i"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: i must be a valid iterator of *this.</para><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that the element pointed by i is placed as the root of the tree, improving future searches of this value.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4807. <method name="splay_down"><type>iterator</type><template>
  4808. <template-type-parameter name="KeyType"/>
  4809. <template-type-parameter name="KeyTypeKeyCompare"/>
  4810. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree. If the element is not present returns the last node compared with the key. If the tree is empty, end() is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor throws. </para></description></method>
  4811. <method name="splay_down"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Rearranges the container so that if *this stores an element with a key equivalent to value the element is placed as the root of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized logarithmic.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the new root of the tree, end() if the tree is empty.</para><para><emphasis role="bold">Throws</emphasis>: If the predicate throws. </para></description></method>
  4812. <method name="rebalance"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  4813. <method name="rebalance_subtree"><type>iterator</type><parameter name="root"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the elements in the subtree. </para></description></method>
  4814. </method-group>
  4815. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  4816. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container with given comparison and traits.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the key_compare object throws. Basic guarantee. </para></description></constructor>
  4817. <constructor><template>
  4818. <template-type-parameter name="Iterator"/>
  4819. </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare object throws. Basic guarantee. </para></description></constructor>
  4820. <constructor><parameter name="x"><paramtype><classname>splaytree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  4821. <copy-assignment><type><classname>splaytree</classname> &amp;</type><parameter name="x"><paramtype><classname>splaytree</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  4822. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  4823. <method-group name="public static functions">
  4824. <method name="container_from_end_iterator" specifiers="static"><type><classname>splaytree</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4825. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>splaytree</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  4826. <method name="container_from_iterator" specifiers="static"><type><classname>splaytree</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  4827. <method name="container_from_iterator" specifiers="static"><type>const <classname>splaytree</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  4828. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  4829. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  4830. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  4831. </method-group>
  4832. </class>
  4833. </namespace>
  4834. </namespace>
  4835. </header>
  4836. <header name="boost/intrusive/splaytree_algorithms.hpp">
  4837. <namespace name="boost">
  4838. <namespace name="intrusive">
  4839. <class name="splaytree_algorithms"><template>
  4840. <template-type-parameter name="NodeTraits"/>
  4841. </template><description><para>A splay tree is an implementation of a binary search tree. The tree is self balancing using the splay algorithm as described in</para><para>"Self-Adjusting Binary Search Trees by Daniel Dominic Sleator and Robert Endre Tarjan AT&amp;T Bell Laboratories, Murray Hill, NJ Journal of the ACM, Vol 32, no 3, July 1985, pp 652-686</para><para><classname alt="boost::intrusive::splaytree_algorithms">splaytree_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the binary search tree</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput> </para></description><typedef name="node"><type>NodeTraits::node</type></typedef>
  4842. <typedef name="node_traits"><type>NodeTraits</type></typedef>
  4843. <typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
  4844. <typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
  4845. <typedef name="insert_commit_data"><description><para>This type is the information that will be filled by insert_unique_check </para></description><type>bstree_algo::insert_commit_data</type></typedef>
  4846. <method-group name="public static functions">
  4847. <method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4848. <method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4849. <method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const const_node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4850. <method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>const node_ptr &amp;</paramtype></parameter><parameter name="header2"><paramtype>const node_ptr &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4851. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  4852. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  4853. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
  4854. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
  4855. <method name="unlink" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4856. <method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
  4857. <method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4858. <method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4859. <method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4860. <method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4861. <method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  4862. <method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  4863. <method name="erase" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. Additional notes: the previous node of z is splayed to speed up range deletions. </para></description></method>
  4864. <method name="transfer_unique" specifiers="static"><type>bool</type><template>
  4865. <template-type-parameter name="NodePtrCompare"/>
  4866. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  4867. <method name="transfer_equal" specifiers="static"><type>void</type><template>
  4868. <template-type-parameter name="NodePtrCompare"/>
  4869. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  4870. <method name="clone" specifiers="static"><type>void</type><template>
  4871. <template-type-parameter name="Cloner"/>
  4872. <template-type-parameter name="Disposer"/>
  4873. </template><parameter name="source_header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  4874. <method name="clear_and_dispose" specifiers="static"><type>void</type><template>
  4875. <template-type-parameter name="Disposer"/>
  4876. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  4877. <method name="count" specifiers="static"><type>std::size_t</type><template>
  4878. <template-type-parameter name="KeyType"/>
  4879. <template-type-parameter name="KeyNodePtrCompare"/>
  4880. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: an element with key <computeroutput>key</computeroutput> is splayed. </para></description></method>
  4881. <method name="count" specifiers="static"><type>std::size_t</type><template>
  4882. <template-type-parameter name="KeyType"/>
  4883. <template-type-parameter name="KeyNodePtrCompare"/>
  4884. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
  4885. <method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
  4886. <template-type-parameter name="KeyType"/>
  4887. <template-type-parameter name="KeyNodePtrCompare"/>
  4888. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the first node of the range is splayed. </para></description></method>
  4889. <method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
  4890. <template-type-parameter name="KeyType"/>
  4891. <template-type-parameter name="KeyNodePtrCompare"/>
  4892. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
  4893. <method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
  4894. <template-type-parameter name="KeyType"/>
  4895. <template-type-parameter name="KeyNodePtrCompare"/>
  4896. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the first node of the range is splayed. </para></description></method>
  4897. <method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
  4898. <template-type-parameter name="KeyType"/>
  4899. <template-type-parameter name="KeyNodePtrCompare"/>
  4900. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
  4901. <method name="find" specifiers="static"><type>node_ptr</type><template>
  4902. <template-type-parameter name="KeyType"/>
  4903. <template-type-parameter name="KeyNodePtrCompare"/>
  4904. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the found node of the lower bound is splayed. </para></description></method>
  4905. <method name="find" specifiers="static"><type>node_ptr</type><template>
  4906. <template-type-parameter name="KeyType"/>
  4907. <template-type-parameter name="KeyNodePtrCompare"/>
  4908. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
  4909. <method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  4910. <template-type-parameter name="KeyType"/>
  4911. <template-type-parameter name="KeyNodePtrCompare"/>
  4912. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the first node of the range is splayed. </para></description></method>
  4913. <method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  4914. <template-type-parameter name="KeyType"/>
  4915. <template-type-parameter name="KeyNodePtrCompare"/>
  4916. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
  4917. <method name="lower_bound_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  4918. <template-type-parameter name="KeyType"/>
  4919. <template-type-parameter name="KeyNodePtrCompare"/>
  4920. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing the first element that is equivalent to "key" according to "comp" or an empty range that indicates the position where that element would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional notes: the first node of the range is splayed. </para></description></method>
  4921. <method name="lower_bound_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  4922. <template-type-parameter name="KeyType"/>
  4923. <template-type-parameter name="KeyNodePtrCompare"/>
  4924. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing the first element that is equivalent to "key" according to "comp" or an empty range that indicates the position where that element would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: no splaying is performed </para></description></method>
  4925. <method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  4926. <template-type-parameter name="KeyType"/>
  4927. <template-type-parameter name="KeyNodePtrCompare"/>
  4928. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. Additional notes: the first node of the range is splayed. </para></description></method>
  4929. <method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  4930. <template-type-parameter name="KeyType"/>
  4931. <template-type-parameter name="KeyNodePtrCompare"/>
  4932. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. Additional note: no splaying is performed </para></description></method>
  4933. <method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
  4934. <template-type-parameter name="NodePtrCompare"/>
  4935. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: the inserted node is splayed </para></description></method>
  4936. <method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
  4937. <template-type-parameter name="NodePtrCompare"/>
  4938. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the lower bound according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: the inserted node is splayed </para></description></method>
  4939. <method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
  4940. <template-type-parameter name="NodePtrCompare"/>
  4941. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. Additional note: the inserted node is splayed </para></description></method>
  4942. <method name="insert_before" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. Additional note: the inserted node is splayed </para></description></method>
  4943. <method name="push_back" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". Additional note: the inserted node is splayed </para></description></method>
  4944. <method name="push_front" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". Additional note: the inserted node is splayed </para></description></method>
  4945. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  4946. <template-type-parameter name="KeyType"/>
  4947. <template-type-parameter name="KeyNodePtrCompare"/>
  4948. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. Additional note: nodes with the given key are splayed </para></description></method>
  4949. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  4950. <template-type-parameter name="KeyType"/>
  4951. <template-type-parameter name="KeyNodePtrCompare"/>
  4952. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. Additional note: nodes with the given key are splayed </para></description></method>
  4953. <method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_value"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  4954. <method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  4955. <method name="rebalance" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the tree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  4956. <method name="rebalance_subtree" specifiers="static"><type>node_ptr</type><parameter name="old_root"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: old_root is a node of a tree. It shall not be null.</para><para><emphasis role="bold">Effects</emphasis>: Rebalances the subtree rooted at old_root.</para><para><emphasis role="bold">Returns</emphasis>: The new root of the subtree.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Linear. </para></description></method>
  4957. <method name="splay_up" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter></method>
  4958. <method name="splay_down" specifiers="static"><type>node_ptr</type><template>
  4959. <template-type-parameter name="KeyType"/>
  4960. <template-type-parameter name="KeyNodePtrCompare"/>
  4961. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="pfound"><paramtype>bool *</paramtype><default>0</default></parameter></method>
  4962. </method-group>
  4963. </class>
  4964. </namespace>
  4965. </namespace>
  4966. </header>
  4967. <header name="boost/intrusive/treap.hpp">
  4968. <namespace name="boost">
  4969. <namespace name="intrusive">
  4970. <struct name="make_treap"><template>
  4971. <template-type-parameter name="T"/>
  4972. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4973. </template><description><para>Helper metafunction to define a <computeroutput>treap</computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="packed_options"><type><classname>pack_options</classname>&lt; treap_defaults, O1, O2, O3, O4, O5, O6, O7 &gt;::<classname>type</classname></type></typedef>
  4974. <typedef name="value_traits"><type><emphasis>unspecified</emphasis></type></typedef>
  4975. <typedef name="implementation_defined"><type><classname>treap</classname>&lt; value_traits, typename packed_options::key_of_value, typename packed_options::compare, typename packed_options::priority_of_value, typename packed_options::priority, typename packed_options::size_type, packed_options::constant_time_size, typename packed_options::header_holder_type &gt;</type></typedef>
  4976. <typedef name="type"><type><classname>implementation_defined</classname></type></typedef>
  4977. </struct><class name="treap"><template>
  4978. <template-type-parameter name="T"/>
  4979. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  4980. </template><description><para>The class template treap is an intrusive treap container that is used to construct intrusive set and multiset containers. The no-throw guarantee holds only, if the key_compare object and priority_compare object don't throw.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>compare&lt;&gt;</computeroutput>, <computeroutput>priority&lt;&gt;</computeroutput> and <computeroutput>priority_of_value&lt;&gt;</computeroutput> </para></description><typedef name="value_traits"><type>ValueTraits</type></typedef>
  4981. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  4982. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  4983. <typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  4984. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  4985. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  4986. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  4987. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  4988. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  4989. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  4990. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  4991. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  4992. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  4993. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  4994. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  4995. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  4996. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  4997. <typedef name="node"><type>implementation_defined::node</type></typedef>
  4998. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  4999. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  5000. <typedef name="node_algorithms"><type>implementation_defined</type></typedef>
  5001. <typedef name="priority_type"><type>implementation_defined</type></typedef>
  5002. <typedef name="priority_of_value"><type>implementation_defined</type></typedef>
  5003. <typedef name="priority_compare"><type>implementation_defined</type></typedef>
  5004. <typedef name="prio_node_prio_comp_t"><type><emphasis>unspecified</emphasis></type></typedef>
  5005. <typedef name="insert_commit_data"><type>node_algorithms::insert_commit_data</type></typedef>
  5006. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  5007. <data-member name="stateful_value_traits" specifiers="static"><type>const bool</type></data-member>
  5008. <data-member name="safemode_or_autounlink" specifiers="static"><type>const bool</type></data-member>
  5009. <method-group name="public member functions">
  5010. <method name="prio_node_prio_comp" cv="const"><type><emphasis>unspecified</emphasis></type><template>
  5011. <template-type-parameter name="PrioPrioComp"/>
  5012. </template><parameter name="priopriocomp"><paramtype>PrioPrioComp</paramtype></parameter></method>
  5013. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5014. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5015. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5016. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5017. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5018. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5019. <method name="top"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the highest priority object of the treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5020. <method name="top" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5021. <method name="ctop" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5022. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5023. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5024. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5025. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5026. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5027. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5028. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5029. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5030. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5031. <method name="rtop"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5032. <method name="rtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5033. <method name="crtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5034. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  5035. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  5036. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5037. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5038. <method name="priority_comp" cv="const"><type>priority_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the priority_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If priority_compare copy-constructor throws. </para></description></method>
  5039. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>treap</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two treaps.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  5040. <method name="clone_from"><type>void</type><template>
  5041. <template-type-parameter name="Cloner"/>
  5042. <template-type-parameter name="Disposer"/>
  5043. </template><parameter name="src"><paramtype>const <classname>treap</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  5044. <method name="clone_from"><type>void</type><template>
  5045. <template-type-parameter name="Cloner"/>
  5046. <template-type-parameter name="Disposer"/>
  5047. </template><parameter name="src"><paramtype><classname>treap</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  5048. <method name="insert_equal"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5049. <method name="insert_equal"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5050. <method name="insert_equal"><type>void</type><template>
  5051. <template-type-parameter name="Iterator"/>
  5052. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by key_comp().</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5053. <method name="insert_unique"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5054. <method name="insert_unique"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5055. <method name="insert_unique"><type>void</type><template>
  5056. <template-type-parameter name="Iterator"/>
  5057. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by key_comp().</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5058. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="prio"><paramtype>const priority_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison or predicate functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  5059. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="prio"><paramtype>const priority_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison or predicate functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  5060. <method name="insert_unique_check"><type>std::pair&lt; iterator BOOST_INTRUSIVE_I bool &gt;</type><template>
  5061. <template-type-parameter name="KeyType"/>
  5062. <template-type-parameter name="KeyTypeKeyCompare"/>
  5063. <template-type-parameter name="PrioType"/>
  5064. <template-type-parameter name="PrioValuePrioCompare"/>
  5065. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="prio_value_pcomp"><paramtype>PrioValuePrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. prio_value_pcomp must be a comparison function that induces the same strict weak ordering as priority_compare. The difference is that prio_value_pcomp and comp compare an arbitrary key/priority with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comp or prio_value_pcomp ordering functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  5066. <method name="insert_unique_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  5067. <template-type-parameter name="KeyType"/>
  5068. <template-type-parameter name="KeyTypeKeyCompare"/>
  5069. <template-type-parameter name="PrioType"/>
  5070. <template-type-parameter name="PrioValuePrioCompare"/>
  5071. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="prio_value_pcomp"><paramtype>PrioValuePrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: comp must be a comparison function that induces the same strict weak ordering as key_compare. prio_value_pcomp must be a comparison function that induces the same strict weak ordering as priority_compare. The difference is that prio_value_pcomp and comp compare an arbitrary key/priority with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comp or prio_value_pcomp ordering functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  5072. <method name="insert_unique_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the <classname alt="boost::intrusive::avl_set">avl_set</classname> using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  5073. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  5074. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  5075. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  5076. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5077. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5078. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5079. <method name="erase"><type>size_type</type><template>
  5080. <template-type-parameter name="KeyType"/>
  5081. <template-type-parameter name="KeyTypeKeyCompare"/>
  5082. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Equivalent guarantee to <emphasis>while(beg != end) erase(beg++);</emphasis></para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5083. <method name="erase_and_dispose"><type>iterator</type><template>
  5084. <template-type-parameter name="Disposer"/>
  5085. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5086. <method name="erase_and_dispose"><type>iterator</type><template>
  5087. <template-type-parameter name="Disposer"/>
  5088. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5089. <method name="erase_and_dispose"><type>size_type</type><template>
  5090. <template-type-parameter name="Disposer"/>
  5091. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5092. <method name="erase_and_dispose"><type>size_type</type><template>
  5093. <template-type-parameter name="KeyType"/>
  5094. <template-type-parameter name="KeyTypeKeyCompare"/>
  5095. <template-type-parameter name="Disposer"/>
  5096. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5097. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5098. <method name="clear_and_dispose"><type>void</type><template>
  5099. <template-type-parameter name="Disposer"/>
  5100. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  5101. <method name="merge_unique"><type>void</type><template>
  5102. <template-type-parameter name="T"/>
  5103. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  5104. </template><parameter name=""><paramtype><classname>sgtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  5105. <method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
  5106. <method name="merge_equal"><type>void</type><template>
  5107. <template-type-parameter name="T"/>
  5108. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  5109. </template><parameter name=""><paramtype><classname>sgtree</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Extracts each element in source and insert it into a using the comparison object of *this.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  5110. <method name="while"><type/><parameter name=""><paramtype>it !</paramtype><default>itend</default></parameter></method>
  5111. <method name="check" cv="const"><type>void</type><template>
  5112. <template-type-parameter name="ExtraChecker"/>
  5113. </template><parameter name="extra_checker"><paramtype>ExtraChecker</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container with additional checks provided by the user.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
  5114. <method name="check" cv="const"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Asserts the integrity of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Note</emphasis>: The method has no effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions. </para></description></method>
  5115. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5116. <method name="count" cv="const"><type>size_type</type><template>
  5117. <template-type-parameter name="KeyType"/>
  5118. <template-type-parameter name="KeyTypeKeyCompare"/>
  5119. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5120. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5121. <method name="lower_bound"><type>iterator</type><template>
  5122. <template-type-parameter name="KeyType"/>
  5123. <template-type-parameter name="KeyTypeKeyCompare"/>
  5124. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5125. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5126. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  5127. <template-type-parameter name="KeyType"/>
  5128. <template-type-parameter name="KeyTypeKeyCompare"/>
  5129. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5130. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5131. <method name="upper_bound"><type>iterator</type><template>
  5132. <template-type-parameter name="KeyType"/>
  5133. <template-type-parameter name="KeyTypeKeyCompare"/>
  5134. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5135. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5136. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  5137. <template-type-parameter name="KeyType"/>
  5138. <template-type-parameter name="KeyTypeKeyCompare"/>
  5139. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5140. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5141. <method name="find"><type>iterator</type><template>
  5142. <template-type-parameter name="KeyType"/>
  5143. <template-type-parameter name="KeyTypeKeyCompare"/>
  5144. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5145. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5146. <method name="find" cv="const"><type>const_iterator</type><template>
  5147. <template-type-parameter name="KeyType"/>
  5148. <template-type-parameter name="KeyTypeKeyCompare"/>
  5149. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5150. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5151. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  5152. <template-type-parameter name="KeyType"/>
  5153. <template-type-parameter name="KeyTypeKeyCompare"/>
  5154. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5155. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5156. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  5157. <template-type-parameter name="KeyType"/>
  5158. <template-type-parameter name="KeyTypeKeyCompare"/>
  5159. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5160. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5161. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  5162. <template-type-parameter name="KeyType"/>
  5163. <template-type-parameter name="KeyTypeKeyCompare"/>
  5164. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5165. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5166. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  5167. <template-type-parameter name="KeyType"/>
  5168. <template-type-parameter name="KeyTypeKeyCompare"/>
  5169. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5170. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5171. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5172. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  5173. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  5174. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  5175. </method-group>
  5176. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
  5177. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
  5178. <constructor><template>
  5179. <template-type-parameter name="Iterator"/>
  5180. </template><parameter name="unique"><paramtype>bool</paramtype></parameter><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
  5181. <constructor><parameter name="x"><paramtype><classname>treap</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal comparison object and value traits are move constructed and nodes belonging to x (except the node representing the "end") are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of the comparison objet throws. </para></description></constructor>
  5182. <copy-assignment><type><classname>treap</classname> &amp;</type><parameter name="x"><paramtype><classname>treap</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap </para></description></copy-assignment>
  5183. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  5184. <method-group name="public static functions">
  5185. <method name="container_from_end_iterator" specifiers="static"><type><classname>treap</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  5186. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>treap</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  5187. <method name="container_from_iterator" specifiers="static"><type><classname>treap</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  5188. <method name="container_from_iterator" specifiers="static"><type>const <classname>treap</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  5189. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  5190. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  5191. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  5192. </method-group>
  5193. </class>
  5194. </namespace>
  5195. </namespace>
  5196. </header>
  5197. <header name="boost/intrusive/treap_algorithms.hpp">
  5198. <namespace name="boost">
  5199. <namespace name="intrusive">
  5200. <class name="treap_algorithms"><template>
  5201. <template-type-parameter name="NodeTraits"/>
  5202. </template><description><para><classname alt="boost::intrusive::treap_algorithms">treap_algorithms</classname> provides basic algorithms to manipulate nodes forming a treap.</para><para>(1) the header node is maintained with links not only to the root but also to the leftmost node of the tree, to enable constant time begin(), and to the rightmost node of the tree, to enable linear time performance when used with the generic set algorithms (set_union, etc.);</para><para>(2) when a node being deleted has two children its successor node is relinked into its place, rather than copied, so that the only pointers invalidated are those referring to the deleted node.</para><para><classname alt="boost::intrusive::treap_algorithms">treap_algorithms</classname> is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. NodeTraits must support the following interface:</para><para><emphasis role="bold">Typedefs</emphasis>:</para><para><computeroutput>node</computeroutput>: The type of the node that forms the treap</para><para><computeroutput>node_ptr</computeroutput>: A pointer to a node</para><para><computeroutput>const_node_ptr</computeroutput>: A pointer to a const node</para><para><emphasis role="bold">Static functions</emphasis>:</para><para><computeroutput>static node_ptr get_parent(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_parent(node_ptr n, node_ptr parent);</computeroutput></para><para><computeroutput>static node_ptr get_left(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_left(node_ptr n, node_ptr left);</computeroutput></para><para><computeroutput>static node_ptr get_right(const_node_ptr n);</computeroutput></para><para><computeroutput>static void set_right(node_ptr n, node_ptr right);</computeroutput> </para></description><struct name="insert_commit_data"><description><para>This type is the information that will be filled by insert_unique_check </para></description></struct><typedef name="node_traits"><type>NodeTraits</type></typedef>
  5203. <typedef name="node"><type>NodeTraits::node</type></typedef>
  5204. <typedef name="node_ptr"><type>NodeTraits::node_ptr</type></typedef>
  5205. <typedef name="const_node_ptr"><type>NodeTraits::const_node_ptr</type></typedef>
  5206. <method-group name="public static functions">
  5207. <method name="get_header" specifiers="static"><type>node_ptr</type><parameter name="n"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a header node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5208. <method name="begin_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the first node of the tree, the header if the tree is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5209. <method name="end_node" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'header' is the header node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5210. <method name="swap_tree" specifiers="static"><type>void</type><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5211. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  5212. <method name="swap_nodes" specifiers="static"><type>void</type><parameter name="node1"><paramtype>node_ptr</paramtype></parameter><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="node2"><paramtype>node_ptr</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node1 and node2 can't be header nodes of two trees with header header1 and header2.</para><para><emphasis role="bold">Effects</emphasis>: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.</para><para>Experimental function </para></description></method>
  5213. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function </para></description></method>
  5214. <method name="replace_node" specifiers="static"><type>void</type><parameter name="node_to_be_replaced"><paramtype>node_ptr</paramtype></parameter><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.</para><para><emphasis role="bold">Effects</emphasis>: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function </para></description></method>
  5215. <method name="unlink" specifiers="static"><type>void</type><template>
  5216. <template-type-parameter name="NodePtrPriorityCompare"/>
  5217. </template><parameter name="node"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a tree node but not the header.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the node and rebalances the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5218. <method name="unlink_leftmost_without_rebalance" specifiers="static"><type>node_ptr</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header is the header of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree. </para></description></method>
  5219. <method name="unique" specifiers="static"><type>bool</type><parameter name="node"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node of the tree or a node initialized by init(...) or init_node.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if the node is initialized by init() or init_node().</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5220. <method name="size" specifiers="static"><type>std::size_t</type><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node is a node of the tree but it's not the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of nodes of the subtree.</para><para><emphasis role="bold">Complexity</emphasis>: Linear time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5221. <method name="next_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the header.</para><para><emphasis role="bold">Effects</emphasis>: Returns the next node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5222. <method name="prev_node" specifiers="static"><type>node_ptr</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' is a node from the tree except the leftmost node.</para><para><emphasis role="bold">Effects</emphasis>: Returns the previous node of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Average constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5223. <method name="init" specifiers="static"><type>void</type><parameter name="node"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: 'node' must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: After the function unique(node) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  5224. <method name="init_header" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: node must not be part of any tree.</para><para><emphasis role="bold">Effects</emphasis>: Initializes the header to represent an empty tree. unique(header) == true.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Nodes</emphasis>: If node is inserted in a tree, this function corrupts the tree. </para></description></method>
  5225. <method name="erase" specifiers="static"><type>node_ptr</type><template>
  5226. <template-type-parameter name="NodePtrPriorityCompare"/>
  5227. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header must be the header of a tree, z a node of that tree and z != header.</para><para><emphasis role="bold">Effects</emphasis>: Erases node "z" from the tree with header "header".</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5228. <method name="clone" specifiers="static"><type>void</type><template>
  5229. <template-type-parameter name="Cloner"/>
  5230. <template-type-parameter name="Disposer"/>
  5231. </template><parameter name="source_header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="target_header"><paramtype>node_ptr</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. "disposer" must take a node_ptr and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: First empties target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para>Then, duplicates the entire tree pointed by "source_header" cloning each source node with <computeroutput>node_ptr Cloner::operator()(const node_ptr &amp;)</computeroutput> to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using <computeroutput>void disposer(const node_ptr &amp;)</computeroutput>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  5232. <method name="clear_and_dispose" specifiers="static"><type>void</type><template>
  5233. <template-type-parameter name="Disposer"/>
  5234. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Empties the target tree calling <computeroutput>void disposer::operator()(const node_ptr &amp;)</computeroutput> for every node of the tree except the header.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.</para><para><emphasis role="bold">Throws</emphasis>: If cloner functor throws. If this happens target nodes are disposed. </para></description></method>
  5235. <method name="lower_bound" specifiers="static"><type>node_ptr</type><template>
  5236. <template-type-parameter name="KeyType"/>
  5237. <template-type-parameter name="KeyNodePtrCompare"/>
  5238. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  5239. <method name="upper_bound" specifiers="static"><type>node_ptr</type><template>
  5240. <template-type-parameter name="KeyType"/>
  5241. <template-type-parameter name="KeyNodePtrCompare"/>
  5242. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  5243. <method name="find" specifiers="static"><type>node_ptr</type><template>
  5244. <template-type-parameter name="KeyType"/>
  5245. <template-type-parameter name="KeyNodePtrCompare"/>
  5246. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  5247. <method name="equal_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  5248. <template-type-parameter name="KeyType"/>
  5249. <template-type-parameter name="KeyNodePtrCompare"/>
  5250. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  5251. <method name="bounded_range" specifiers="static"><type>std::pair&lt; node_ptr, node_ptr &gt;</type><template>
  5252. <template-type-parameter name="KeyType"/>
  5253. <template-type-parameter name="KeyNodePtrCompare"/>
  5254. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be true.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change. </para></description></method>
  5255. <method name="count" specifiers="static"><type>std::size_t</type><template>
  5256. <template-type-parameter name="KeyType"/>
  5257. <template-type-parameter name="KeyNodePtrCompare"/>
  5258. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements with a key equivalent to "key" according to "comp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  5259. <method name="insert_equal_upper_bound" specifiers="static"><type>node_ptr</type><template>
  5260. <template-type-parameter name="NodePtrCompare"/>
  5261. <template-type-parameter name="NodePtrPriorityCompare"/>
  5262. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp" and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throw or "pcomp" throw. </para></description></method>
  5263. <method name="insert_equal_lower_bound" specifiers="static"><type>node_ptr</type><template>
  5264. <template-type-parameter name="NodePtrCompare"/>
  5265. <template-type-parameter name="NodePtrPriorityCompare"/>
  5266. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "h" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before the upper bound according to "comp" and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws. </para></description></method>
  5267. <method name="insert_equal" specifiers="static"><type>node_ptr</type><template>
  5268. <template-type-parameter name="NodePtrCompare"/>
  5269. <template-type-parameter name="NodePtrPriorityCompare"/>
  5270. </template><parameter name="h"><paramtype>node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case). Rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throw or "pcomp" throw. </para></description></method>
  5271. <method name="insert_before" specifiers="static"><type>node_ptr</type><template>
  5272. <template-type-parameter name="NodePtrPriorityCompare"/>
  5273. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="pos"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "pos" must be a valid node of the tree (including header end) node. "pos" must be a node pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node into the tree before "pos" and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: If "pcomp" throws, strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken. </para></description></method>
  5274. <method name="push_back" specifiers="static"><type>void</type><template>
  5275. <template-type-parameter name="NodePtrPriorityCompare"/>
  5276. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering no less than the greatest inserted key. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the tree in the last position and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: If "pcomp" throws, strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  5277. <method name="push_front" specifiers="static"><type>void</type><template>
  5278. <template-type-parameter name="NodePtrPriorityCompare"/>
  5279. </template><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="pcomp"><paramtype>NodePtrPriorityCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "new_node" must be, according to the used ordering, no greater than the lowest inserted key. NodePtrPriorityCompare is a priority function object that induces a strict weak ordering compatible with the one used to create the the tree. NodePtrPriorityCompare compares two node_ptrs.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the tree in the first position and rotates the tree according to "pcomp".</para><para><emphasis role="bold">Complexity</emphasis>: Constant-time.</para><para><emphasis role="bold">Throws</emphasis>: If "pcomp" throws, strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before". </para></description></method>
  5280. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  5281. <template-type-parameter name="KeyType"/>
  5282. <template-type-parameter name="KeyNodePtrCompare"/>
  5283. <template-type-parameter name="PrioType"/>
  5284. <template-type-parameter name="PrioNodePtrPrioCompare"/>
  5285. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="pcomp"><paramtype>PrioNodePtrPrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype><classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  5286. <method name="insert_unique_check" specifiers="static"><type>std::pair&lt; node_ptr, bool &gt;</type><template>
  5287. <template-type-parameter name="KeyType"/>
  5288. <template-type-parameter name="KeyNodePtrCompare"/>
  5289. <template-type-parameter name="PrioType"/>
  5290. <template-type-parameter name="PrioNodePtrPrioCompare"/>
  5291. </template><parameter name="header"><paramtype>const_node_ptr</paramtype></parameter><parameter name="hint"><paramtype>node_ptr</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyNodePtrCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="pcomp"><paramtype>PrioNodePtrPrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype><classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.</para><para><emphasis role="bold">Effects</emphasis>: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".</para><para><emphasis role="bold">Throws</emphasis>: If "comp" throws.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set. </para></description></method>
  5292. <method name="insert_unique_commit" specifiers="static"><type>void</type><parameter name="header"><paramtype>node_ptr</paramtype></parameter><parameter name="new_node"><paramtype>node_ptr</paramtype></parameter><parameter name="commit_data"><paramtype>const <classname>insert_commit_data</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "header" must be the header node of a tree. "commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  5293. <method name="transfer_unique" specifiers="static"><type>bool</type><template>
  5294. <template-type-parameter name="NodePtrCompare"/>
  5295. <template-type-parameter name="PrioNodePtrPrioCompare"/>
  5296. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>PrioNodePtrPrioCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2 if tree1 does not contain a node that is equivalent to z.</para><para><emphasis role="bold">Returns</emphasis>: True if the node was trasferred, false otherwise.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  5297. <method name="transfer_equal" specifiers="static"><type>void</type><template>
  5298. <template-type-parameter name="NodePtrCompare"/>
  5299. <template-type-parameter name="PrioNodePtrPrioCompare"/>
  5300. </template><parameter name="header1"><paramtype>node_ptr</paramtype></parameter><parameter name="comp"><paramtype>NodePtrCompare</paramtype></parameter><parameter name="pcomp"><paramtype>PrioNodePtrPrioCompare</paramtype></parameter><parameter name="header2"><paramtype>node_ptr</paramtype></parameter><parameter name="z"><paramtype>node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: header1 and header2 must be the headers of trees tree1 and tree2 respectively, z a non-header node of tree1. NodePtrCompare is the comparison function of tree1..</para><para><emphasis role="bold">Effects</emphasis>: Transfers node "z" from tree1 to tree2.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison throws. </para></description></method>
  5301. <method name="is_header" specifiers="static"><type>bool</type><parameter name="p"><paramtype>const_node_ptr</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: p is a node of a tree.</para><para><emphasis role="bold">Effects</emphasis>: Returns true if p is the header of the tree.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5302. </method-group>
  5303. </class>
  5304. </namespace>
  5305. </namespace>
  5306. </header>
  5307. <header name="boost/intrusive/treap_set.hpp">
  5308. <namespace name="boost">
  5309. <namespace name="intrusive">
  5310. <struct name="make_treap_multiset"><template>
  5311. <template-type-parameter name="T"/>
  5312. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  5313. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::treap_multiset">treap_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="packed_options"><type><classname>pack_options</classname>&lt; treap_defaults, O1, O2, O3, O4, O5, O6, O7 &gt;::<classname>type</classname></type></typedef>
  5314. <typedef name="value_traits"><type><emphasis>unspecified</emphasis></type></typedef>
  5315. <typedef name="implementation_defined"><type><classname>treap_multiset</classname>&lt; value_traits, typename packed_options::key_of_value, typename packed_options::compare, typename packed_options::priority_of_value, typename packed_options::priority, typename packed_options::size_type, packed_options::constant_time_size, typename packed_options::header_holder_type &gt;</type></typedef>
  5316. <typedef name="type"><type><classname>implementation_defined</classname></type></typedef>
  5317. </struct><struct name="make_treap_set"><template>
  5318. <template-type-parameter name="T"/>
  5319. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  5320. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::treap_set">treap_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="packed_options"><type><classname>pack_options</classname>&lt; treap_defaults, O1, O2, O3, O4, O5, O6, O7 &gt;::<classname>type</classname></type></typedef>
  5321. <typedef name="value_traits"><type><emphasis>unspecified</emphasis></type></typedef>
  5322. <typedef name="implementation_defined"><type><classname>treap_set</classname>&lt; value_traits, typename packed_options::key_of_value, typename packed_options::compare, typename packed_options::priority_of_value, typename packed_options::priority, typename packed_options::size_type, packed_options::constant_time_size, typename packed_options::header_holder_type &gt;</type></typedef>
  5323. <typedef name="type"><type><classname>implementation_defined</classname></type></typedef>
  5324. </struct><class name="treap_multiset"><template>
  5325. <template-type-parameter name="T"/>
  5326. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  5327. </template><description><para>The class template <classname alt="boost::intrusive::treap_multiset">treap_multiset</classname> is an intrusive container, that mimics most of the interface of std::treap_multiset as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>compare&lt;&gt;</computeroutput>, <computeroutput>priority&lt;&gt;</computeroutput> and <computeroutput>priority_of_value&lt;&gt;</computeroutput> </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  5328. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  5329. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  5330. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  5331. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  5332. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  5333. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  5334. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  5335. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  5336. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  5337. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  5338. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  5339. <typedef name="priority_type"><type>implementation_defined::priority_type</type></typedef>
  5340. <typedef name="priority_compare"><type>implementation_defined::priority_compare</type></typedef>
  5341. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  5342. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  5343. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  5344. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  5345. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  5346. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  5347. <typedef name="node"><type>implementation_defined::node</type></typedef>
  5348. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  5349. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  5350. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  5351. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  5352. <method-group name="public member functions">
  5353. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5354. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5355. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5356. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5357. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5358. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5359. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5360. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5361. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5362. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5363. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5364. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5365. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5366. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5367. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5368. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  5369. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  5370. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5371. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5372. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>treap_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two treaps.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  5373. <method name="clone_from"><type>void</type><template>
  5374. <template-type-parameter name="Cloner"/>
  5375. <template-type-parameter name="Disposer"/>
  5376. </template><parameter name="src"><paramtype>const <classname>treap_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  5377. <method name="clone_from"><type>void</type><template>
  5378. <template-type-parameter name="Cloner"/>
  5379. <template-type-parameter name="Disposer"/>
  5380. </template><parameter name="src"><paramtype><classname>treap_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  5381. <method name="top"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the highest priority object of the treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5382. <method name="top" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5383. <method name="ctop" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5384. <method name="rtop"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5385. <method name="rtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5386. <method name="crtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5387. <method name="priority_comp" cv="const"><type>priority_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5388. <method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container before the upper bound.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5389. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator.</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case)</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5390. <method name="insert"><type>void</type><template>
  5391. <template-type-parameter name="Iterator"/>
  5392. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Inserts a each element of a range into the container before the upper bound of the key of each element.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by key_comp().</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5393. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  5394. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  5395. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  5396. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5397. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5398. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5399. <method name="erase"><type>size_type</type><template>
  5400. <template-type-parameter name="KeyType"/>
  5401. <template-type-parameter name="KeyTypeKeyCompare"/>
  5402. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Equivalent guarantee to <emphasis>while(beg != end) erase(beg++);</emphasis></para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5403. <method name="erase_and_dispose"><type>iterator</type><template>
  5404. <template-type-parameter name="Disposer"/>
  5405. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5406. <method name="erase_and_dispose"><type>iterator</type><template>
  5407. <template-type-parameter name="Disposer"/>
  5408. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5409. <method name="erase_and_dispose"><type>size_type</type><template>
  5410. <template-type-parameter name="Disposer"/>
  5411. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5412. <method name="erase_and_dispose"><type>size_type</type><template>
  5413. <template-type-parameter name="KeyType"/>
  5414. <template-type-parameter name="KeyTypeKeyCompare"/>
  5415. <template-type-parameter name="Disposer"/>
  5416. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5417. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5418. <method name="clear_and_dispose"><type>void</type><template>
  5419. <template-type-parameter name="Disposer"/>
  5420. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  5421. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5422. <method name="count" cv="const"><type>size_type</type><template>
  5423. <template-type-parameter name="KeyType"/>
  5424. <template-type-parameter name="KeyTypeKeyCompare"/>
  5425. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5426. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5427. <method name="lower_bound"><type>iterator</type><template>
  5428. <template-type-parameter name="KeyType"/>
  5429. <template-type-parameter name="KeyTypeKeyCompare"/>
  5430. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5431. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5432. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  5433. <template-type-parameter name="KeyType"/>
  5434. <template-type-parameter name="KeyTypeKeyCompare"/>
  5435. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5436. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5437. <method name="upper_bound"><type>iterator</type><template>
  5438. <template-type-parameter name="KeyType"/>
  5439. <template-type-parameter name="KeyTypeKeyCompare"/>
  5440. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5441. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5442. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  5443. <template-type-parameter name="KeyType"/>
  5444. <template-type-parameter name="KeyTypeKeyCompare"/>
  5445. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5446. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5447. <method name="find"><type>iterator</type><template>
  5448. <template-type-parameter name="KeyType"/>
  5449. <template-type-parameter name="KeyTypeKeyCompare"/>
  5450. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5451. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5452. <method name="find" cv="const"><type>const_iterator</type><template>
  5453. <template-type-parameter name="KeyType"/>
  5454. <template-type-parameter name="KeyTypeKeyCompare"/>
  5455. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5456. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5457. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  5458. <template-type-parameter name="KeyType"/>
  5459. <template-type-parameter name="KeyTypeKeyCompare"/>
  5460. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5461. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5462. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  5463. <template-type-parameter name="KeyType"/>
  5464. <template-type-parameter name="KeyTypeKeyCompare"/>
  5465. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5466. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5467. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  5468. <template-type-parameter name="KeyType"/>
  5469. <template-type-parameter name="KeyTypeKeyCompare"/>
  5470. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5471. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5472. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  5473. <template-type-parameter name="KeyType"/>
  5474. <template-type-parameter name="KeyTypeKeyCompare"/>
  5475. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5476. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5477. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5478. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  5479. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  5480. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  5481. <method name="merge"><type>void</type><template>
  5482. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  5483. </template><parameter name="source"><paramtype><classname>treap_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  5484. <method name="merge"><type>void</type><template>
  5485. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  5486. </template><parameter name="source"><paramtype><classname>treap_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  5487. </method-group>
  5488. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
  5489. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
  5490. <constructor><template>
  5491. <template-type-parameter name="Iterator"/>
  5492. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
  5493. <constructor><parameter name="x"><paramtype><classname>treap_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></constructor>
  5494. <copy-assignment><type><classname>treap_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>treap_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></copy-assignment>
  5495. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  5496. <method-group name="public static functions">
  5497. <method name="container_from_end_iterator" specifiers="static"><type><classname>treap_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  5498. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>treap_multiset</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  5499. <method name="container_from_iterator" specifiers="static"><type><classname>treap_multiset</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  5500. <method name="container_from_iterator" specifiers="static"><type>const <classname>treap_multiset</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  5501. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  5502. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  5503. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  5504. </method-group>
  5505. </class><class name="treap_set"><template>
  5506. <template-type-parameter name="T"/>
  5507. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  5508. </template><description><para>The class template <classname alt="boost::intrusive::treap_set">treap_set</classname> is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>compare&lt;&gt;</computeroutput>, <computeroutput>priority&lt;&gt;</computeroutput> and <computeroutput>priority_of_value&lt;&gt;</computeroutput> </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  5509. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  5510. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  5511. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  5512. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  5513. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  5514. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  5515. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  5516. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  5517. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  5518. <typedef name="value_compare"><type>implementation_defined::value_compare</type></typedef>
  5519. <typedef name="key_compare"><type>implementation_defined::key_compare</type></typedef>
  5520. <typedef name="priority_type"><type>implementation_defined::priority_type</type></typedef>
  5521. <typedef name="priority_compare"><type>implementation_defined::priority_compare</type></typedef>
  5522. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  5523. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  5524. <typedef name="reverse_iterator"><type>implementation_defined::reverse_iterator</type></typedef>
  5525. <typedef name="const_reverse_iterator"><type>implementation_defined::const_reverse_iterator</type></typedef>
  5526. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  5527. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  5528. <typedef name="node"><type>implementation_defined::node</type></typedef>
  5529. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  5530. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  5531. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  5532. <data-member name="constant_time_size" specifiers="static"><type>const bool</type></data-member>
  5533. <method-group name="public member functions">
  5534. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5535. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5536. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5537. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5538. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5539. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5540. <method name="rbegin"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5541. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5542. <method name="crbegin" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5543. <method name="rend"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5544. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5545. <method name="crend" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the end of the reversed container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5546. <method name="root"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a iterator pointing to the root node of the container or end() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5547. <method name="root" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5548. <method name="croot" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5549. <method name="key_comp" cv="const"><type>key_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_compare copy-constructor throws. </para></description></method>
  5550. <method name="value_comp" cv="const"><type>value_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the value_compare object used by the container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_compare copy-constructor throws. </para></description></method>
  5551. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5552. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the container.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5553. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>treap_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swaps the contents of two treaps.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison functor's swap call throws. </para></description></method>
  5554. <method name="clone_from"><type>void</type><template>
  5555. <template-type-parameter name="Cloner"/>
  5556. <template-type-parameter name="Disposer"/>
  5557. </template><parameter name="src"><paramtype>const <classname>treap_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  5558. <method name="clone_from"><type>void</type><template>
  5559. <template-type-parameter name="Cloner"/>
  5560. <template-type-parameter name="Disposer"/>
  5561. </template><parameter name="src"><paramtype><classname>treap_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</para><para>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner throws or predicate copy assignment throws. Basic guarantee. </para></description></method>
  5562. <method name="top"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the highest priority object of the treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5563. <method name="top" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5564. <method name="ctop" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the highest priority object of the treap..</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5565. <method name="rtop"><type>reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5566. <method name="rtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5567. <method name="crtop" cv="const"><type>const_reverse_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5568. <method name="priority_comp" cv="const"><type>priority_compare</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5569. <method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts value into the container if the value is not already present.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for insert element is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5570. <method name="insert"><type>iterator</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and "hint" must be a valid iterator</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5571. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="prio"><paramtype>const priority_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is at most logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison or predicate functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  5572. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="prio"><paramtype>const priority_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</para><para><emphasis role="bold">Throws</emphasis>: If the comparison or predicate functions throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </para></description></method>
  5573. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  5574. <template-type-parameter name="KeyType"/>
  5575. <template-type-parameter name="KeyTypeKeyCompare"/>
  5576. <template-type-parameter name="PrioType"/>
  5577. <template-type-parameter name="PrioValuePrioCompare"/>
  5578. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="pcomp"><paramtype>PrioValuePrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
  5579. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  5580. <template-type-parameter name="KeyType"/>
  5581. <template-type-parameter name="KeyTypeKeyCompare"/>
  5582. <template-type-parameter name="PrioType"/>
  5583. <template-type-parameter name="PrioValuePrioCompare"/>
  5584. </template><parameter name="hint"><paramtype>const_iterator</paramtype></parameter><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="prio"><paramtype>const PrioType &amp;</paramtype></parameter><parameter name="pcomp"><paramtype>PrioValuePrioCompare</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter></method>
  5585. <method name="insert"><type>void</type><template>
  5586. <template-type-parameter name="Iterator"/>
  5587. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Tries to insert each element of a range into the container.</para><para><emphasis role="bold">Complexity</emphasis>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by key_comp().</para><para><emphasis role="bold">Throws</emphasis>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5588. <method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the <classname alt="boost::intrusive::avl_set">avl_set</classname> using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </para></description></method>
  5589. <method name="insert_before"><type>iterator</type><parameter name="pos"><paramtype>const_iterator</paramtype></parameter><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container before "pos".</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  5590. <method name="push_back"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no less than the greatest inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the last position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  5591. <method name="push_front"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue, and it must be no greater than the minimum inserted key</para><para><emphasis role="bold">Effects</emphasis>: Inserts x into the container in the first position.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: If the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </para></description></method>
  5592. <method name="erase"><type>iterator</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5593. <method name="erase"><type>iterator</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5594. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5595. <method name="erase"><type>size_type</type><template>
  5596. <template-type-parameter name="KeyType"/>
  5597. <template-type-parameter name="KeyTypeKeyCompare"/>
  5598. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp".</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Equivalent guarantee to <emphasis>while(beg != end) erase(beg++);</emphasis></para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5599. <method name="erase_and_dispose"><type>iterator</type><template>
  5600. <template-type-parameter name="Disposer"/>
  5601. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase element is constant time.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5602. <method name="erase_and_dispose"><type>iterator</type><template>
  5603. <template-type-parameter name="Disposer"/>
  5604. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</para><para><emphasis role="bold">Throws</emphasis>: if the internal priority_compare function throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5605. <method name="erase_and_dispose"><type>size_type</type><template>
  5606. <template-type-parameter name="Disposer"/>
  5607. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5608. <method name="erase_and_dispose"><type>size_type</type><template>
  5609. <template-type-parameter name="KeyType"/>
  5610. <template-type-parameter name="KeyTypeKeyCompare"/>
  5611. <template-type-parameter name="Disposer"/>
  5612. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: O(log(size() + N).</para><para><emphasis role="bold">Throws</emphasis>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5613. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5614. <method name="clear_and_dispose"><type>void</type><template>
  5615. <template-type-parameter name="Disposer"/>
  5616. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements calling disposer(p) for each node to be erased. <emphasis role="bold">Complexity</emphasis>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </para></description></method>
  5617. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5618. <method name="count" cv="const"><type>size_type</type><template>
  5619. <template-type-parameter name="KeyType"/>
  5620. <template-type-parameter name="KeyTypeKeyCompare"/>
  5621. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5622. <method name="lower_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5623. <method name="lower_bound"><type>iterator</type><template>
  5624. <template-type-parameter name="KeyType"/>
  5625. <template-type-parameter name="KeyTypeKeyCompare"/>
  5626. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5627. <method name="lower_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5628. <method name="lower_bound" cv="const"><type>const_iterator</type><template>
  5629. <template-type-parameter name="KeyType"/>
  5630. <template-type-parameter name="KeyTypeKeyCompare"/>
  5631. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5632. <method name="upper_bound"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5633. <method name="upper_bound"><type>iterator</type><template>
  5634. <template-type-parameter name="KeyType"/>
  5635. <template-type-parameter name="KeyTypeKeyCompare"/>
  5636. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5637. <method name="upper_bound" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5638. <method name="upper_bound" cv="const"><type>const_iterator</type><template>
  5639. <template-type-parameter name="KeyType"/>
  5640. <template-type-parameter name="KeyTypeKeyCompare"/>
  5641. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5642. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5643. <method name="find"><type>iterator</type><template>
  5644. <template-type-parameter name="KeyType"/>
  5645. <template-type-parameter name="KeyTypeKeyCompare"/>
  5646. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5647. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5648. <method name="find" cv="const"><type>const_iterator</type><template>
  5649. <template-type-parameter name="KeyType"/>
  5650. <template-type-parameter name="KeyTypeKeyCompare"/>
  5651. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5652. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5653. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  5654. <template-type-parameter name="KeyType"/>
  5655. <template-type-parameter name="KeyTypeKeyCompare"/>
  5656. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5657. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws. </para></description></method>
  5658. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  5659. <template-type-parameter name="KeyType"/>
  5660. <template-type-parameter name="KeyTypeKeyCompare"/>
  5661. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: key is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <computeroutput>*this</computeroutput>.</para><para><emphasis role="bold">Effects</emphasis>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws. </para></description></method>
  5662. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5663. <method name="bounded_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  5664. <template-type-parameter name="KeyType"/>
  5665. <template-type-parameter name="KeyTypeKeyCompare"/>
  5666. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5667. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="lower_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!key_comp()(upper_key, lower_key) &amp;&amp; !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</para><para>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>key_compare</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5668. <method name="bounded_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  5669. <template-type-parameter name="KeyType"/>
  5670. <template-type-parameter name="KeyTypeKeyCompare"/>
  5671. </template><parameter name="lower_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="upper_key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="comp"><paramtype>KeyTypeKeyCompare</paramtype></parameter><parameter name="left_closed"><paramtype>bool</paramtype></parameter><parameter name="right_closed"><paramtype>bool</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: <computeroutput>lower_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</para><para><computeroutput>upper_key</computeroutput> is a value such that <computeroutput>*this</computeroutput> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</para><para><computeroutput>upper_key</computeroutput> shall not precede <computeroutput>lower_key</computeroutput> according to comp [comp(upper_key, lower_key) shall be false]</para><para>If <computeroutput>lower_key</computeroutput> is equivalent to <computeroutput>upper_key</computeroutput> [!comp(upper_key, lower_key) &amp;&amp; !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</para><para><emphasis role="bold">Effects</emphasis>: Returns an a pair with the following criteria:</para><para>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</para><para>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic.</para><para><emphasis role="bold">Throws</emphasis>: If <computeroutput>comp</computeroutput> throws.</para><para><emphasis role="bold">Note</emphasis>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</para><para><emphasis role="bold">Note</emphasis>: Experimental function, the interface might change in future releases. </para></description></method>
  5672. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5673. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5674. <method name="unlink_leftmost_without_rebalance"><type>pointer</type><description><para><emphasis role="bold">Effects</emphasis>: Unlinks the leftmost node from the container.</para><para><emphasis role="bold">Complexity</emphasis>: Average complexity is constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </para></description></method>
  5675. <method name="replace_node"><type>void</type><parameter name="replace_this"><paramtype>iterator</paramtype></parameter><parameter name="with_this"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</para><para><emphasis role="bold">Effects</emphasis>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </para></description></method>
  5676. <method name="remove_node"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: removes "value" from the container.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic time.</para><para><emphasis role="bold">Note</emphasis>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</para><para>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </para></description></method>
  5677. <method name="merge"><type>void</type><template>
  5678. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  5679. </template><parameter name="source"><paramtype><classname>treap_set</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  5680. <method name="merge"><type>void</type><template>
  5681. <template-nontype-parameter name="Options2"><type>class ...</type></template-nontype-parameter>
  5682. </template><parameter name="source"><paramtype><classname>treap_multiset</classname>&lt; T, Options2... &gt; &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "source" container's Options can only can differ in the comparison function from *this.</para><para><emphasis role="bold">Effects</emphasis>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</para><para><emphasis role="bold">Postcondition</emphasis>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</para><para><emphasis role="bold">Throws</emphasis>: Nothing unless the comparison object throws.</para><para><emphasis role="bold">Complexity</emphasis>: N log(a.size() + N) (N has the value source.size()) </para></description></method>
  5683. </method-group>
  5684. <constructor><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
  5685. <constructor specifiers="explicit"><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
  5686. <constructor><template>
  5687. <template-type-parameter name="Iterator"/>
  5688. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="cmp"><paramtype>const key_compare &amp;</paramtype><default>key_compare()</default></parameter><parameter name="pcmp"><paramtype>const priority_compare &amp;</paramtype><default>priority_compare()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare/priority_compare objects throw. Basic guarantee. </para></description></constructor>
  5689. <constructor><parameter name="x"><paramtype><classname>treap_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></constructor>
  5690. <copy-assignment><type><classname>treap_set</classname> &amp;</type><parameter name="x"><paramtype><classname>treap_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></copy-assignment>
  5691. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <classname alt="boost::intrusive::value_traits">value_traits</classname> template parameter are reinitialized and thus can be reused.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  5692. <method-group name="public static functions">
  5693. <method name="container_from_end_iterator" specifiers="static"><type><classname>treap_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  5694. <method name="container_from_end_iterator" specifiers="static"><type>const <classname>treap_set</classname> &amp;</type><parameter name="end_iterator"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: end_iterator must be a valid end iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the end iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant. </para></description></method>
  5695. <method name="container_from_iterator" specifiers="static"><type><classname>treap_set</classname> &amp;</type><parameter name="it"><paramtype>iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  5696. <method name="container_from_iterator" specifiers="static"><type>const <classname>treap_set</classname> &amp;</type><parameter name="it"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Precondition</emphasis>: it must be a valid iterator of the container.</para><para><emphasis role="bold">Effects</emphasis>: Returns a const reference to the container associated to the iterator</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Logarithmic. </para></description></method>
  5697. <method name="s_iterator_to" specifiers="static"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  5698. <method name="s_iterator_to" specifiers="static"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator i belonging to the set that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  5699. <method name="init_node" specifiers="static"><type>void</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value shall not be in a container.</para><para><emphasis role="bold">Effects</emphasis>: init_node puts the hook of a value in a well-known default state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Note</emphasis>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </para></description></method>
  5700. </method-group>
  5701. </class>
  5702. </namespace>
  5703. </namespace>
  5704. </header>
  5705. <header name="boost/intrusive/trivial_value_traits.hpp">
  5706. <namespace name="boost">
  5707. <namespace name="intrusive">
  5708. <struct name="trivial_value_traits"><template>
  5709. <template-type-parameter name="NodeTraits"/>
  5710. <template-nontype-parameter name="LinkMode"><type>link_mode_type</type><default>safe_link</default></template-nontype-parameter>
  5711. </template><description><para>This value traits template is used to create value traits from user defined node traits where value_traits::value_type and node_traits::node should be equal </para></description><typedef name="node_traits"><type>NodeTraits</type></typedef>
  5712. <typedef name="node_ptr"><type>node_traits::node_ptr</type></typedef>
  5713. <typedef name="const_node_ptr"><type>node_traits::const_node_ptr</type></typedef>
  5714. <typedef name="value_type"><type>node_traits::node</type></typedef>
  5715. <typedef name="pointer"><type>node_ptr</type></typedef>
  5716. <typedef name="const_pointer"><type>const_node_ptr</type></typedef>
  5717. <data-member name="link_mode" specifiers="static"><type>const link_mode_type</type></data-member>
  5718. <method-group name="public static functions">
  5719. <method name="to_node_ptr" specifiers="static"><type>node_ptr</type><parameter name="value"><paramtype>value_type &amp;</paramtype></parameter></method>
  5720. <method name="to_node_ptr" specifiers="static"><type>const_node_ptr</type><parameter name="value"><paramtype>const value_type &amp;</paramtype></parameter></method>
  5721. <method name="to_value_ptr" specifiers="static"><type>const pointer &amp;</type><parameter name="n"><paramtype>const node_ptr &amp;</paramtype></parameter></method>
  5722. <method name="to_value_ptr" specifiers="static"><type>const const_pointer &amp;</type><parameter name="n"><paramtype>const const_node_ptr &amp;</paramtype></parameter></method>
  5723. </method-group>
  5724. </struct>
  5725. </namespace>
  5726. </namespace>
  5727. </header>
  5728. <header name="boost/intrusive/unordered_set.hpp">
  5729. <namespace name="boost">
  5730. <namespace name="intrusive">
  5731. <struct name="make_unordered_multiset"><template>
  5732. <template-type-parameter name="T"/>
  5733. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  5734. </template><description><para>Helper metafunction to define an <computeroutput><classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  5735. </struct><struct name="make_unordered_set"><template>
  5736. <template-type-parameter name="T"/>
  5737. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  5738. </template><description><para>Helper metafunction to define an <computeroutput><classname alt="boost::intrusive::unordered_set">unordered_set</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  5739. </struct><class name="unordered_multiset"><template>
  5740. <template-type-parameter name="T"/>
  5741. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  5742. </template><inherit access="public">boost::intrusive::hashtable&lt; ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags &gt;</inherit><description><para>The class template <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> is an intrusive container, that mimics most of the interface of std::tr1::unordered_multiset as described in the C++ TR1.</para><para><classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> is a semi-intrusive container: each object to be stored in the container must contain a proper hook, but the container also needs additional auxiliary memory to work: <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> needs a pointer to an array of type <computeroutput>bucket_type</computeroutput> to be passed in the constructor. This bucket array must have at least the same lifetime as the container. This makes the use of <classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> more complicated than purely intrusive containers. <computeroutput>bucket_type</computeroutput> is default-constructible, copyable and assignable</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>hash&lt;&gt;</computeroutput> and <computeroutput>equal&lt;&gt;</computeroutput> <computeroutput>bucket_traits&lt;&gt;</computeroutput>, <computeroutput>power_2_buckets&lt;&gt;</computeroutput> and <computeroutput>cache_begin&lt;&gt;</computeroutput>.</para><para><classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname> only provides forward iterators but it provides 4 iterator types: iterator and const_iterator to navigate through the whole container and local_iterator and const_local_iterator to navigate through the values stored in a single bucket. Local iterators are faster and smaller.</para><para>It's not recommended to use non constant-time size unordered_multisets because several key functions, like "empty()", become non-constant time functions. Non constant-time size unordered_multisets are mainly provided to support auto-unlink hooks.</para><para><classname alt="boost::intrusive::unordered_multiset">unordered_multiset</classname>, unlike std::unordered_set, does not make automatic rehashings nor offers functions related to a load factor. Rehashing can be explicitly requested and the user must provide a new bucket array that will be used from that moment.</para><para>Since no automatic rehashing is done, iterators are never invalidated when inserting or erasing elements. Iterators are only invalidated when rehasing. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  5743. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  5744. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  5745. <typedef name="bucket_traits"><type>implementation_defined::bucket_traits</type></typedef>
  5746. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  5747. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  5748. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  5749. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  5750. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  5751. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  5752. <typedef name="key_equal"><type>implementation_defined::key_equal</type></typedef>
  5753. <typedef name="hasher"><type>implementation_defined::hasher</type></typedef>
  5754. <typedef name="bucket_type"><type>implementation_defined::bucket_type</type></typedef>
  5755. <typedef name="bucket_ptr"><type>implementation_defined::bucket_ptr</type></typedef>
  5756. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  5757. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  5758. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  5759. <typedef name="local_iterator"><type>implementation_defined::local_iterator</type></typedef>
  5760. <typedef name="const_local_iterator"><type>implementation_defined::const_local_iterator</type></typedef>
  5761. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  5762. <typedef name="node"><type>implementation_defined::node</type></typedef>
  5763. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  5764. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  5765. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  5766. <method-group name="public member functions">
  5767. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5768. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5769. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5770. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5771. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5772. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5773. <method name="hash_function" cv="const"><type>hasher</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the hasher object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hasher copy-constructor throws. </para></description></method>
  5774. <method name="key_eq" cv="const"><type>key_equal</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_equal object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_equal copy-constructor throws. </para></description></method>
  5775. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: if constant-time size and <classname alt="boost::intrusive::cache_begin">cache_begin</classname> options are disabled, average constant time (worst case, with empty() == true: O(this-&gt;bucket_count()). Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5776. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is false. Constant-time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5777. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>unordered_multiset</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></method>
  5778. <method name="clone_from"><type>void</type><template>
  5779. <template-type-parameter name="Cloner"/>
  5780. <template-type-parameter name="Disposer"/>
  5781. </template><parameter name="src"><paramtype>const <classname>unordered_multiset</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
  5782. <method name="clone_from"><type>void</type><template>
  5783. <template-type-parameter name="Cloner"/>
  5784. <template-type-parameter name="Disposer"/>
  5785. </template><parameter name="src"><paramtype><classname>unordered_multiset</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
  5786. <method name="insert"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value into the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the inserted value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5787. <method name="insert"><type>void</type><template>
  5788. <template-type-parameter name="Iterator"/>
  5789. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Equivalent to this-&gt;insert_equal(t) for each element in [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(N), where N is distance(b, e). Worst case O(N*this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5790. <method name="erase"><type>void</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. No destructors are called. </para></description></method>
  5791. <method name="erase"><type>void</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5792. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5793. <method name="erase"><type>size_type</type><template>
  5794. <template-type-parameter name="KeyType"/>
  5795. <template-type-parameter name="KeyHasher"/>
  5796. <template-type-parameter name="KeyEqual"/>
  5797. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements that have the same hash and compare equal with the given key.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5798. <method name="erase_and_dispose"><type>void</type><template>
  5799. <template-type-parameter name="Disposer"/>
  5800. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5801. <method name="erase_and_dispose"><type>void</type><template>
  5802. <template-type-parameter name="Disposer"/>
  5803. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5804. <method name="erase_and_dispose"><type>size_type</type><template>
  5805. <template-type-parameter name="Disposer"/>
  5806. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5807. <method name="erase_and_dispose"><type>size_type</type><template>
  5808. <template-type-parameter name="KeyType"/>
  5809. <template-type-parameter name="KeyHasher"/>
  5810. <template-type-parameter name="KeyEqual"/>
  5811. <template-type-parameter name="Disposer"/>
  5812. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "equal_func". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5813. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5814. <method name="clear_and_dispose"><type>void</type><template>
  5815. <template-type-parameter name="Disposer"/>
  5816. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5817. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5818. <method name="count" cv="const"><type>size_type</type><template>
  5819. <template-type-parameter name="KeyType"/>
  5820. <template-type-parameter name="KeyHasher"/>
  5821. <template-type-parameter name="KeyEqual"/>
  5822. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal throw. </para></description></method>
  5823. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element is equal to "value" or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5824. <method name="find"><type>iterator</type><template>
  5825. <template-type-parameter name="KeyType"/>
  5826. <template-type-parameter name="KeyHasher"/>
  5827. <template-type-parameter name="KeyEqual"/>
  5828. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hash and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  5829. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5830. <method name="find" cv="const"><type>const_iterator</type><template>
  5831. <template-type-parameter name="KeyType"/>
  5832. <template-type-parameter name="KeyHasher"/>
  5833. <template-type-parameter name="KeyEqual"/>
  5834. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hasher and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  5835. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5836. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  5837. <template-type-parameter name="KeyType"/>
  5838. <template-type-parameter name="KeyHasher"/>
  5839. <template-type-parameter name="KeyEqual"/>
  5840. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or the equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  5841. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5842. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  5843. <template-type-parameter name="KeyType"/>
  5844. <template-type-parameter name="KeyHasher"/>
  5845. <template-type-parameter name="KeyEqual"/>
  5846. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the hasher or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  5847. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
  5848. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
  5849. <method name="local_iterator_to"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5850. <method name="local_iterator_to" cv="const"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5851. <method name="bucket_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of buckets passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5852. <method name="bucket_size" cv="const"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements in the nth bucket.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5853. <method name="bucket" cv="const"><type>size_type</type><parameter name="k"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the hash functor throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
  5854. <method name="bucket" cv="const"><type>size_type</type><template>
  5855. <template-type-parameter name="KeyType"/>
  5856. <template-type-parameter name="KeyHasher"/>
  5857. </template><parameter name="k"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hash_func throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
  5858. <method name="bucket_pointer" cv="const"><type>bucket_ptr</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the bucket array pointer passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5859. <method name="begin"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  5860. <method name="begin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  5861. <method name="cbegin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  5862. <method name="end"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  5863. <method name="end" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  5864. <method name="cend" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  5865. <method name="rehash"><type>void</type><parameter name="new_bucket_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_bucket_traits can hold a pointer to a new bucket array or the same as the old bucket array with a different length. new_size is the length of the the array pointed by new_buckets. If new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer() new_bucket_traits.bucket_count() can be bigger or smaller than this-&gt;bucket_count(). 'new_bucket_traits' copy constructor should not throw.</para><para><emphasis role="bold">Effects</emphasis>: If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is false, unlinks values from the old bucket and inserts then in the new one according to the hash value of values.</para><para>If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is true, the implementations avoids moving values as much as possible.</para><para>Bucket traits hold by *this is assigned from new_bucket_traits. If the container is configured as incremental&lt;&gt;, the split bucket is set to the new bucket_count().</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function. If false, the implementation tries to minimize calls to the hash function (e.g. once for equivalent values if optimize_multikey&lt;true&gt; is true).</para><para>If rehash is successful updates the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> with new_bucket_traits.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
  5866. <method name="full_rehash"><type>void</type><description><para><emphasis role="bold">Note</emphasis>: This function is used when keys from inserted elements are changed (e.g. a language change when key is a string) but uniqueness and hash properties are preserved so a fast full rehash recovers invariants for *this without extracting and reinserting all elements again.</para><para><emphasis role="bold">Requires</emphasis>: Calls produced to the hash function should not alter the value uniqueness properties of already inserted elements. If hasher(key1) == hasher(key2) was true when elements were inserted, it shall be true during calls produced in the execution of this function.</para><para>key_equal is not called inside this function so it is assumed that key_equal(value1, value2) should produce the same results as before for inserted elements.</para><para><emphasis role="bold">Effects</emphasis>: Reprocesses all values hold by *this, recalculating their hash values and redistributing them though the buckets.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method uses the hash function and updates the stored hash value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
  5867. <method name="incremental_rehash"><type>bool</type><parameter name="grow"><paramtype>bool</paramtype><default>true</default></parameter><description><para><emphasis role="bold">Requires</emphasis>:</para><para><emphasis role="bold">Effects</emphasis>:</para><para><emphasis role="bold">Complexity</emphasis>:</para><para><emphasis role="bold">Throws</emphasis>:</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
  5868. <method name="incremental_rehash"><type>bool</type><parameter name="new_bucket_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If new_bucket_traits.bucket_count() is not this-&gt;bucket_count()/2 or this-&gt;bucket_count()*2, or this-&gt;split_bucket() != new_bucket_traits.bucket_count() returns false and does nothing.</para><para>Otherwise, copy assigns new_bucket_traits to the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> and transfers all the objects from old buckets to the new ones.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to size().</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
  5869. <method name="split_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Requires</emphasis>: incremental&lt;&gt; option must be set</para><para><emphasis role="bold">Effects</emphasis>: returns the current split count</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing </para></description></method>
  5870. </method-group>
  5871. <constructor specifiers="explicit"><parameter name="b_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
  5872. <constructor><template>
  5873. <template-type-parameter name="Iterator"/>
  5874. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="b_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource and dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: If N is distance(b, e): Average case is O(N) (with a good hash function and with buckets_len &gt;= N),worst case O(N^2).</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hasher or key_equal throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
  5875. <constructor><parameter name="x"><paramtype><classname>unordered_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></constructor>
  5876. <copy-assignment><type><classname>unordered_multiset</classname> &amp;</type><parameter name="x"><paramtype><classname>unordered_multiset</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: to-do </para></description></copy-assignment>
  5877. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> are not deleted (i.e. no destructors are called).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, if it's a safe-mode or auto-unlink value. Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  5878. <method-group name="public static functions">
  5879. <method name="s_local_iterator_to" specifiers="static"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  5880. <method name="s_local_iterator_to" specifiers="static"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  5881. <method name="suggested_upper_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is bigger or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the higher possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5882. <method name="suggested_lower_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is smaller or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the lowest possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5883. </method-group>
  5884. </class><class name="unordered_set"><template>
  5885. <template-type-parameter name="T"/>
  5886. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  5887. </template><inherit access="public">boost::intrusive::hashtable&lt; ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrKeyEqual, BucketTraits, SizeType, BoolFlags|hash_bool_flags::unique_keys_pos &gt;</inherit><description><para>The class template <classname alt="boost::intrusive::unordered_set">unordered_set</classname> is an intrusive container, that mimics most of the interface of std::tr1::unordered_set as described in the C++ TR1.</para><para><classname alt="boost::intrusive::unordered_set">unordered_set</classname> is a semi-intrusive container: each object to be stored in the container must contain a proper hook, but the container also needs additional auxiliary memory to work: <classname alt="boost::intrusive::unordered_set">unordered_set</classname> needs a pointer to an array of type <computeroutput>bucket_type</computeroutput> to be passed in the constructor. This bucket array must have at least the same lifetime as the container. This makes the use of <classname alt="boost::intrusive::unordered_set">unordered_set</classname> more complicated than purely intrusive containers. <computeroutput>bucket_type</computeroutput> is default-constructible, copyable and assignable</para><para>The template parameter <computeroutput>T</computeroutput> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</para><para>The container supports the following options: <computeroutput>base_hook&lt;&gt;/member_hook&lt;&gt;/value_traits&lt;&gt;</computeroutput>, <computeroutput>constant_time_size&lt;&gt;</computeroutput>, <computeroutput>size_type&lt;&gt;</computeroutput>, <computeroutput>hash&lt;&gt;</computeroutput> and <computeroutput>equal&lt;&gt;</computeroutput> <computeroutput>bucket_traits&lt;&gt;</computeroutput>, <computeroutput>power_2_buckets&lt;&gt;</computeroutput> and <computeroutput>cache_begin&lt;&gt;</computeroutput>.</para><para><classname alt="boost::intrusive::unordered_set">unordered_set</classname> only provides forward iterators but it provides 4 iterator types: iterator and const_iterator to navigate through the whole container and local_iterator and const_local_iterator to navigate through the values stored in a single bucket. Local iterators are faster and smaller.</para><para>It's not recommended to use non constant-time size unordered_sets because several key functions, like "empty()", become non-constant time functions. Non constant-time size unordered_sets are mainly provided to support auto-unlink hooks.</para><para><classname alt="boost::intrusive::unordered_set">unordered_set</classname>, unlike std::unordered_set, does not make automatic rehashings nor offers functions related to a load factor. Rehashing can be explicitly requested and the user must provide a new bucket array that will be used from that moment.</para><para>Since no automatic rehashing is done, iterators are never invalidated when inserting or erasing elements. Iterators are only invalidated when rehasing. </para></description><typedef name="value_type"><type>implementation_defined::value_type</type></typedef>
  5888. <typedef name="key_type"><type>implementation_defined::key_type</type></typedef>
  5889. <typedef name="key_of_value"><type>implementation_defined::key_of_value</type></typedef>
  5890. <typedef name="value_traits"><type>implementation_defined::value_traits</type></typedef>
  5891. <typedef name="bucket_traits"><type>implementation_defined::bucket_traits</type></typedef>
  5892. <typedef name="pointer"><type>implementation_defined::pointer</type></typedef>
  5893. <typedef name="const_pointer"><type>implementation_defined::const_pointer</type></typedef>
  5894. <typedef name="reference"><type>implementation_defined::reference</type></typedef>
  5895. <typedef name="const_reference"><type>implementation_defined::const_reference</type></typedef>
  5896. <typedef name="difference_type"><type>implementation_defined::difference_type</type></typedef>
  5897. <typedef name="size_type"><type>implementation_defined::size_type</type></typedef>
  5898. <typedef name="key_equal"><type>implementation_defined::key_equal</type></typedef>
  5899. <typedef name="hasher"><type>implementation_defined::hasher</type></typedef>
  5900. <typedef name="bucket_type"><type>implementation_defined::bucket_type</type></typedef>
  5901. <typedef name="bucket_ptr"><type>implementation_defined::bucket_ptr</type></typedef>
  5902. <typedef name="iterator"><type>implementation_defined::iterator</type></typedef>
  5903. <typedef name="const_iterator"><type>implementation_defined::const_iterator</type></typedef>
  5904. <typedef name="insert_commit_data"><type>implementation_defined::insert_commit_data</type></typedef>
  5905. <typedef name="local_iterator"><type>implementation_defined::local_iterator</type></typedef>
  5906. <typedef name="const_local_iterator"><type>implementation_defined::const_local_iterator</type></typedef>
  5907. <typedef name="node_traits"><type>implementation_defined::node_traits</type></typedef>
  5908. <typedef name="node"><type>implementation_defined::node</type></typedef>
  5909. <typedef name="node_ptr"><type>implementation_defined::node_ptr</type></typedef>
  5910. <typedef name="const_node_ptr"><type>implementation_defined::const_node_ptr</type></typedef>
  5911. <typedef name="node_algorithms"><type>implementation_defined::node_algorithms</type></typedef>
  5912. <method-group name="public member functions">
  5913. <method name="begin"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5914. <method name="begin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5915. <method name="cbegin" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the beginning of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time. Worst case (empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>): O(this-&gt;bucket_count())</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5916. <method name="end"><type>iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns an iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5917. <method name="end" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5918. <method name="cend" cv="const"><type>const_iterator</type><description><para><emphasis role="bold">Effects</emphasis>: Returns a const_iterator pointing to the end of the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5919. <method name="hash_function" cv="const"><type>hasher</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the hasher object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hasher copy-constructor throws. </para></description></method>
  5920. <method name="key_eq" cv="const"><type>key_equal</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the key_equal object used by the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If key_equal copy-constructor throws. </para></description></method>
  5921. <method name="empty" cv="const"><type>bool</type><description><para><emphasis role="bold">Effects</emphasis>: Returns true if the container is empty.</para><para><emphasis role="bold">Complexity</emphasis>: if constant-time size and <classname alt="boost::intrusive::cache_begin">cache_begin</classname> options are disabled, average constant time (worst case, with empty() == true: O(this-&gt;bucket_count()). Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5922. <method name="size" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements stored in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to elements contained in *this if <classname alt="boost::intrusive::constant_time_size">constant_time_size</classname> is false. Constant-time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  5923. <method name="swap"><type>void</type><parameter name="other"><paramtype><classname>unordered_set</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></method>
  5924. <method name="clone_from"><type>void</type><template>
  5925. <template-type-parameter name="Cloner"/>
  5926. <template-type-parameter name="Disposer"/>
  5927. </template><parameter name="src"><paramtype>const <classname>unordered_set</classname> &amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
  5928. <method name="clone_from"><type>void</type><template>
  5929. <template-type-parameter name="Cloner"/>
  5930. <template-type-parameter name="Disposer"/>
  5931. </template><parameter name="src"><paramtype><classname>unordered_set</classname> &amp;&amp;</paramtype></parameter><parameter name="cloner"><paramtype>Cloner</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw Cloner should yield to nodes that compare equal and produce the same hash than the original node.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. The hash function and the equality predicate are copied from the source.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function.</para><para>If any operation throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to erased plus inserted elements.</para><para><emphasis role="bold">Throws</emphasis>: If cloner or hasher throw or hash or equality predicate copying throws. Basic guarantee. </para></description></method>
  5932. <method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue</para><para><emphasis role="bold">Effects</emphasis>: Tries to inserts value into the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para><emphasis role="bold">Returns</emphasis>: If the value is not already present inserts it and returns a pair containing the iterator to the new value and true. If there is an equivalent value returns a pair containing an iterator to the already present value and false.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Strong guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5933. <method name="insert"><type>void</type><template>
  5934. <template-type-parameter name="Iterator"/>
  5935. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Equivalent to this-&gt;insert_unique(t) for each element in [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(N), where N is distance(b, e). Worst case O(N*this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Does not affect the validity of iterators and references. No copy-constructors are called. </para></description></method>
  5936. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hasher or key_compare throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the hash or the equality is much cheaper to construct than the value_type and this function offers the possibility to use that the part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time.</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
  5937. <method name="insert_check"><type>std::pair&lt; iterator, bool &gt;</type><template>
  5938. <template-type-parameter name="KeyType"/>
  5939. <template-type-parameter name="KeyHasher"/>
  5940. <template-type-parameter name="KeyEqual"/>
  5941. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hasher"><paramtype>KeyHasher</paramtype></parameter><parameter name="key_value_equal"><paramtype>KeyEqual</paramtype></parameter><parameter name="commit_data"><paramtype>insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Checks if a value can be inserted in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, using a user provided key instead of the value itself.</para><para><emphasis role="bold">Returns</emphasis>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Strong guarantee.</para><para><emphasis role="bold">Notes</emphasis>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the hash or the equality is much cheaper to construct than the value_type and this function offers the possibility to use that the part to check if the insertion will be successful.</para><para>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time.</para><para>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
  5942. <method name="insert_commit"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><parameter name="commit_data"><paramtype>const insert_commit_data &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> between the "insert_check" that filled "commit_data" and the call to "insert_commit".</para><para><emphasis role="bold">Effects</emphasis>: Inserts the value in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> using the information obtained from the "commit_data" that a previous "insert_check" filled.</para><para><emphasis role="bold">Returns</emphasis>: An iterator to the newly inserted object.</para><para><emphasis role="bold">Complexity</emphasis>: Constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Notes</emphasis>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls.</para><para>After a successful rehashing insert_commit_data remains valid. </para></description></method>
  5943. <method name="erase"><type>void</type><parameter name="i"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased element. No destructors are called. </para></description></method>
  5944. <method name="erase"><type>void</type><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5945. <method name="erase"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5946. <method name="erase"><type>size_type</type><template>
  5947. <template-type-parameter name="KeyType"/>
  5948. <template-type-parameter name="KeyHasher"/>
  5949. <template-type-parameter name="KeyEqual"/>
  5950. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements that have the same hash and compare equal with the given key.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5951. <method name="erase_and_dispose"><type>void</type><template>
  5952. <template-type-parameter name="Disposer"/>
  5953. </template><parameter name="i"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5954. <method name="erase_and_dispose"><type>void</type><template>
  5955. <template-type-parameter name="Disposer"/>
  5956. </template><parameter name="b"><paramtype>const_iterator</paramtype></parameter><parameter name="e"><paramtype>const_iterator</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(distance(b, e)), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5957. <method name="erase_and_dispose"><type>size_type</type><template>
  5958. <template-type-parameter name="Disposer"/>
  5959. </template><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5960. <method name="erase_and_dispose"><type>size_type</type><template>
  5961. <template-type-parameter name="KeyType"/>
  5962. <template-type-parameter name="KeyHasher"/>
  5963. <template-type-parameter name="KeyEqual"/>
  5964. <template-type-parameter name="Disposer"/>
  5965. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all the elements with the given key. according to the comparison functor "equal_func". Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Returns</emphasis>: The number of erased elements.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw. Basic guarantee.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators to the erased elements. </para></description></method>
  5966. <method name="clear"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5967. <method name="clear_and_dispose"><type>void</type><template>
  5968. <template-type-parameter name="Disposer"/>
  5969. </template><parameter name="disposer"><paramtype>Disposer</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: Disposer::operator()(pointer) shouldn't throw.</para><para><emphasis role="bold">Effects</emphasis>: Erases all of the elements.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements on the container. Disposer::operator()(pointer) is called for the removed elements.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </para></description></method>
  5970. <method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5971. <method name="count" cv="const"><type>size_type</type><template>
  5972. <template-type-parameter name="KeyType"/>
  5973. <template-type-parameter name="KeyHasher"/>
  5974. <template-type-parameter name="KeyEqual"/>
  5975. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given key</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal throw. </para></description></method>
  5976. <method name="find"><type>iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element is equal to "value" or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5977. <method name="find"><type>iterator</type><template>
  5978. <template-type-parameter name="KeyType"/>
  5979. <template-type-parameter name="KeyHasher"/>
  5980. <template-type-parameter name="KeyEqual"/>
  5981. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hash and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  5982. <method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of contained elements with the given value</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5983. <method name="find" cv="const"><type>const_iterator</type><template>
  5984. <template-type-parameter name="KeyType"/>
  5985. <template-type-parameter name="KeyHasher"/>
  5986. <template-type-parameter name="KeyEqual"/>
  5987. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Finds an iterator to the first element whose key is "key" according to the given hasher and equality functor or end() if that element does not exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(1), worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  5988. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5989. <method name="equal_range"><type>std::pair&lt; iterator, iterator &gt;</type><template>
  5990. <template-type-parameter name="KeyType"/>
  5991. <template-type-parameter name="KeyHasher"/>
  5992. <template-type-parameter name="KeyEqual"/>
  5993. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If hash_func or the equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  5994. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><parameter name="key"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with values equivalent to value. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(value)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the internal hasher or the equality functor throws. </para></description></method>
  5995. <method name="equal_range" cv="const"><type>std::pair&lt; const_iterator, const_iterator &gt;</type><template>
  5996. <template-type-parameter name="KeyType"/>
  5997. <template-type-parameter name="KeyHasher"/>
  5998. <template-type-parameter name="KeyEqual"/>
  5999. </template><parameter name="key"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><parameter name="equal_func"><paramtype>KeyEqual</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para>"equal_func" must be a equality function that induces the same equality as key_equal. The difference is that "equal_func" compares an arbitrary key with the contained values.</para><para><emphasis role="bold">Effects</emphasis>: Returns a range containing all elements with equivalent keys. Returns std::make_pair(this-&gt;end(), this-&gt;end()) if no such elements exist.</para><para><emphasis role="bold">Complexity</emphasis>: Average case O(this-&gt;count(key, hash_func, equal_func)). Worst case O(this-&gt;size()).</para><para><emphasis role="bold">Throws</emphasis>: If the hasher or equal_func throw.</para><para><emphasis role="bold">Note</emphasis>: This function is used when constructing a value_type is expensive and the value_type can be compared with a cheaper key type. Usually this key is part of the value_type. </para></description></method>
  6000. <method name="iterator_to"><type>iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
  6001. <method name="iterator_to" cv="const"><type>const_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid const_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the internal hash function throws. </para></description></method>
  6002. <method name="local_iterator_to"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6003. <method name="local_iterator_to" cv="const"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6004. <method name="bucket_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the number of buckets passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6005. <method name="bucket_size" cv="const"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns the number of elements in the nth bucket.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6006. <method name="bucket" cv="const"><type>size_type</type><parameter name="k"><paramtype>const key_type &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If the hash functor throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
  6007. <method name="bucket" cv="const"><type>size_type</type><template>
  6008. <template-type-parameter name="KeyType"/>
  6009. <template-type-parameter name="KeyHasher"/>
  6010. </template><parameter name="k"><paramtype>const KeyType &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>KeyHasher</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: "hash_func" must be a hash function that induces the same hash values as the stored hasher. The difference is that "hash_func" hashes the given key instead of the value_type.</para><para><emphasis role="bold">Effects</emphasis>: Returns the index of the bucket in which elements with keys equivalent to k would be found, if any such element existed.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If hash_func throws.</para><para><emphasis role="bold">Note</emphasis>: the return value is in the range [0, this-&gt;bucket_count()). </para></description></method>
  6011. <method name="bucket_pointer" cv="const"><type>bucket_ptr</type><description><para><emphasis role="bold">Effects</emphasis>: Returns the bucket array pointer passed in the constructor or the last rehash function.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6012. <method name="begin"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  6013. <method name="begin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  6014. <method name="cbegin" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the beginning of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  6015. <method name="end"><type>local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  6016. <method name="end" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  6017. <method name="cend" cv="const"><type>const_local_iterator</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: n is in the range [0, this-&gt;bucket_count()).</para><para><emphasis role="bold">Effects</emphasis>: Returns a const_local_iterator pointing to the end of the sequence stored in the bucket n.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: [this-&gt;begin(n), this-&gt;end(n)) is a valid range containing all of the elements in the nth bucket. </para></description></method>
  6018. <method name="rehash"><type>void</type><parameter name="new_bucket_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: new_bucket_traits can hold a pointer to a new bucket array or the same as the old bucket array with a different length. new_size is the length of the the array pointed by new_buckets. If new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer() new_bucket_traits.bucket_count() can be bigger or smaller than this-&gt;bucket_count(). 'new_bucket_traits' copy constructor should not throw.</para><para><emphasis role="bold">Effects</emphasis>: If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is false, unlinks values from the old bucket and inserts then in the new one according to the hash value of values.</para><para>If <computeroutput>new_bucket_traits.bucket_begin() == this-&gt;bucket_pointer()</computeroutput> is true, the implementations avoids moving values as much as possible.</para><para>Bucket traits hold by *this is assigned from new_bucket_traits. If the container is configured as incremental&lt;&gt;, the split bucket is set to the new bucket_count().</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method does not use the hash function. If false, the implementation tries to minimize calls to the hash function (e.g. once for equivalent values if optimize_multikey&lt;true&gt; is true).</para><para>If rehash is successful updates the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> with new_bucket_traits.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
  6019. <method name="full_rehash"><type>void</type><description><para><emphasis role="bold">Note</emphasis>: This function is used when keys from inserted elements are changed (e.g. a language change when key is a string) but uniqueness and hash properties are preserved so a fast full rehash recovers invariants for *this without extracting and reinserting all elements again.</para><para><emphasis role="bold">Requires</emphasis>: Calls produced to the hash function should not alter the value uniqueness properties of already inserted elements. If hasher(key1) == hasher(key2) was true when elements were inserted, it shall be true during calls produced in the execution of this function.</para><para>key_equal is not called inside this function so it is assumed that key_equal(value1, value2) should produce the same results as before for inserted elements.</para><para><emphasis role="bold">Effects</emphasis>: Reprocesses all values hold by *this, recalculating their hash values and redistributing them though the buckets.</para><para>If <classname alt="boost::intrusive::store_hash">store_hash</classname> option is true, this method uses the hash function and updates the stored hash value.</para><para><emphasis role="bold">Complexity</emphasis>: Average case linear in this-&gt;size(), worst case quadratic.</para><para><emphasis role="bold">Throws</emphasis>: If the hasher functor throws. Basic guarantee. </para></description></method>
  6020. <method name="incremental_rehash"><type>bool</type><parameter name="grow"><paramtype>bool</paramtype><default>true</default></parameter><description><para><emphasis role="bold">Requires</emphasis>:</para><para><emphasis role="bold">Effects</emphasis>:</para><para><emphasis role="bold">Complexity</emphasis>:</para><para><emphasis role="bold">Throws</emphasis>:</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
  6021. <method name="incremental_rehash"><type>bool</type><parameter name="new_bucket_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If new_bucket_traits.bucket_count() is not this-&gt;bucket_count()/2 or this-&gt;bucket_count()*2, or this-&gt;split_bucket() != new_bucket_traits.bucket_count() returns false and does nothing.</para><para>Otherwise, copy assigns new_bucket_traits to the internal <classname alt="boost::intrusive::bucket_traits">bucket_traits</classname> and transfers all the objects from old buckets to the new ones.</para><para><emphasis role="bold">Complexity</emphasis>: Linear to size().</para><para><emphasis role="bold">Throws</emphasis>: Nothing</para><para><emphasis role="bold">Note</emphasis>: this method is only available if incremental&lt;true&gt; option is activated. </para></description></method>
  6022. <method name="split_count" cv="const"><type>size_type</type><description><para><emphasis role="bold">Requires</emphasis>: incremental&lt;&gt; option must be set</para><para><emphasis role="bold">Effects</emphasis>: returns the current split count</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing </para></description></method>
  6023. </method-group>
  6024. <constructor specifiers="explicit"><parameter name="b_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, storing a reference to the bucket array and copies of the key_hasher and equal_func functors.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hash_func or equal_func throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
  6025. <constructor><template>
  6026. <template-type-parameter name="Iterator"/>
  6027. </template><parameter name="b"><paramtype>Iterator</paramtype></parameter><parameter name="e"><paramtype>Iterator</paramtype></parameter><parameter name="b_traits"><paramtype>const bucket_traits &amp;</paramtype></parameter><parameter name="hash_func"><paramtype>const hasher &amp;</paramtype><default>hasher()</default></parameter><parameter name="equal_func"><paramtype>const key_equal &amp;</paramtype><default>key_equal()</default></parameter><parameter name="v_traits"><paramtype>const value_traits &amp;</paramtype><default>value_traits()</default></parameter><description><para><emphasis role="bold">Requires</emphasis>: buckets must not be being used by any other resource and dereferencing iterator must yield an lvalue of type value_type.</para><para><emphasis role="bold">Effects</emphasis>: Constructs an empty container and inserts elements from [b, e).</para><para><emphasis role="bold">Complexity</emphasis>: If N is distance(b, e): Average case is O(N) (with a good hash function and with buckets_len &gt;= N),worst case O(N^2).</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor or invocation of hasher or key_equal throws.</para><para><emphasis role="bold">Notes</emphasis>: buckets array must be disposed only after *this is disposed. </para></description></constructor>
  6028. <constructor><parameter name="x"><paramtype><classname>unordered_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Constructs a container moving resources from another container. Internal value traits, bucket traits, hasher and comparison are move constructed and nodes belonging to x are linked to *this.</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: If value_traits::node_traits::node's move constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the move constructor of value traits, bucket traits, hasher or comparison throws. </para></description></constructor>
  6029. <copy-assignment><type><classname>unordered_set</classname> &amp;</type><parameter name="x"><paramtype><classname>unordered_set</classname> &amp;&amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Equivalent to swap. </para></description></copy-assignment>
  6030. <destructor><description><para><emphasis role="bold">Effects</emphasis>: Detaches all elements from this. The objects in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> are not deleted (i.e. no destructors are called).</para><para><emphasis role="bold">Complexity</emphasis>: Linear to the number of elements in the <classname alt="boost::intrusive::unordered_set">unordered_set</classname>, if it's a safe-mode or auto-unlink value. Otherwise constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  6031. <method-group name="public static functions">
  6032. <method name="s_local_iterator_to" specifiers="static"><type>local_iterator</type><parameter name="value"><paramtype>reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  6033. <method name="s_local_iterator_to" specifiers="static"><type>const_local_iterator</type><parameter name="value"><paramtype>const_reference</paramtype></parameter><description><para><emphasis role="bold">Requires</emphasis>: value must be an lvalue and shall be in a <classname alt="boost::intrusive::unordered_set">unordered_set</classname> of appropriate type. Otherwise the behavior is undefined.</para><para><emphasis role="bold">Effects</emphasis>: Returns: a valid local_iterator belonging to the <classname alt="boost::intrusive::unordered_set">unordered_set</classname> that points to the value</para><para><emphasis role="bold">Complexity</emphasis>: Constant.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Note</emphasis>: This static function is available only if the <emphasis>value traits</emphasis> is stateless. </para></description></method>
  6034. <method name="suggested_upper_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is bigger or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the higher possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6035. <method name="suggested_lower_bucket_count" specifiers="static"><type>size_type</type><parameter name="n"><paramtype>size_type</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Returns the nearest new bucket count optimized for the container that is smaller or equal than n. This suggestion can be used to create bucket arrays with a size that will usually improve container's performance. If such value does not exist, the lowest possible value is returned.</para><para><emphasis role="bold">Complexity</emphasis>: Amortized constant time.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6036. </method-group>
  6037. </class>
  6038. </namespace>
  6039. </namespace>
  6040. </header>
  6041. <header name="boost/intrusive/unordered_set_hook.hpp">
  6042. <namespace name="boost">
  6043. <namespace name="intrusive">
  6044. <struct name="make_unordered_set_base_hook"><template>
  6045. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  6046. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::unordered_set_base_hook">unordered_set_base_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  6047. </struct><struct name="make_unordered_set_member_hook"><template>
  6048. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  6049. </template><description><para>Helper metafunction to define a <computeroutput><classname alt="boost::intrusive::unordered_set_member_hook">unordered_set_member_hook</classname></computeroutput> that yields to the same type when the same options (either explicitly or implicitly) are used. </para></description><typedef name="type"><type>implementation_defined</type></typedef>
  6050. </struct><class name="unordered_set_base_hook"><template>
  6051. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  6052. </template><inherit access="public">make_unordered_set_base_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Derive a class from <classname alt="boost::intrusive::unordered_set_base_hook">unordered_set_base_hook</classname> in order to store objects in in an unordered_set/unordered_multi_set. <classname alt="boost::intrusive::unordered_set_base_hook">unordered_set_base_hook</classname> holds the data necessary to maintain the unordered_set/unordered_multi_set and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for unordered_set/unordered_multi_set.</para><para>The hook admits the following options: <computeroutput>tag&lt;&gt;</computeroutput>, <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput>, <computeroutput>store_hash&lt;&gt;</computeroutput> and <computeroutput>optimize_multikey&lt;&gt;</computeroutput>.</para><para><computeroutput>tag&lt;&gt;</computeroutput> defines a tag to identify the node. The same tag value can be used in different classes, but if a class is derived from more than one <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput>, then each <computeroutput><classname alt="boost::intrusive::list_base_hook">list_base_hook</classname></computeroutput> needs its unique tag.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>store_hash&lt;&gt;</computeroutput> will tell the hook to store the hash of the value to speed up rehashings.</para><para><computeroutput>optimize_multikey&lt;&gt;</computeroutput> will tell the hook to store a link to form a group with other value with the same value to speed up searches and insertions in unordered_multisets with a great number of with equivalent keys. </para></description><method-group name="public member functions">
  6053. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>unordered_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6054. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>unordered_set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  6055. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6056. </method-group>
  6057. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  6058. <constructor><parameter name=""><paramtype>const <classname>unordered_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  6059. <copy-assignment><type><classname>unordered_set_base_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>unordered_set_base_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  6060. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an <classname alt="boost::intrusive::unordered_set">unordered_set</classname> an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  6061. </class><class name="unordered_set_member_hook"><template>
  6062. <template-nontype-parameter name="Options"><type>class ...</type></template-nontype-parameter>
  6063. </template><inherit access="public">make_unordered_set_member_hook::type&lt; O1, O2, O3, O4 &gt;</inherit><description><para>Put a public data member <classname alt="boost::intrusive::unordered_set_member_hook">unordered_set_member_hook</classname> in order to store objects of this class in an unordered_set/unordered_multi_set. <classname alt="boost::intrusive::unordered_set_member_hook">unordered_set_member_hook</classname> holds the data necessary for maintaining the unordered_set/unordered_multi_set and provides an appropriate <classname alt="boost::intrusive::value_traits">value_traits</classname> class for unordered_set/unordered_multi_set.</para><para>The hook admits the following options: <computeroutput>void_pointer&lt;&gt;</computeroutput>, <computeroutput>link_mode&lt;&gt;</computeroutput> and <computeroutput>store_hash&lt;&gt;</computeroutput>.</para><para><computeroutput>void_pointer&lt;&gt;</computeroutput> is the pointer type that will be used internally in the hook and the container configured to use this hook.</para><para><computeroutput>link_mode&lt;&gt;</computeroutput> will specify the linking mode of the hook (<computeroutput>normal_link</computeroutput>, <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput>).</para><para><computeroutput>store_hash&lt;&gt;</computeroutput> will tell the hook to store the hash of the value to speed up rehashings. </para></description><method-group name="public member functions">
  6064. <method name="swap_nodes"><type>void</type><parameter name="other"><paramtype><classname>unordered_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Swapping two nodes swaps the position of the elements related to those nodes in one or two containers. That is, if the node this is part of the element e1, the node x is part of the element e2 and both elements are included in the containers s1 and s2, then after the swap-operation e1 is in s2 at the position of e2 and e2 is in s1 at the position of e1. If one element is not in a container, then after the swap-operation the other element is not in a container. Iterators to e1 and e2 related to those nodes are invalidated.</para><para><emphasis role="bold">Complexity</emphasis>: Constant</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6065. <method name="is_linked" cv="const"><type>bool</type><description><para><emphasis role="bold">Precondition</emphasis>: <classname alt="boost::intrusive::link_mode">link_mode</classname> must be <computeroutput>safe_link</computeroutput> or <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Returns</emphasis>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <computeroutput>unordered_set::iterator_to</computeroutput> will return a valid iterator.</para><para><emphasis role="bold">Complexity</emphasis>: Constant </para></description></method>
  6066. <method name="unlink"><type>void</type><description><para><emphasis role="bold">Effects</emphasis>: Removes the node if it's inserted in a container. This function is only allowed if <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput>.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></method>
  6067. </method-group>
  6068. <constructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></constructor>
  6069. <constructor><parameter name=""><paramtype>const <classname>unordered_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> or <computeroutput>safe_link</computeroutput> initializes the node to an unlinked state. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></constructor>
  6070. <copy-assignment><type><classname>unordered_set_member_hook</classname> &amp;</type><parameter name=""><paramtype>const <classname>unordered_set_member_hook</classname> &amp;</paramtype></parameter><description><para><emphasis role="bold">Effects</emphasis>: Empty function. The argument is ignored.</para><para><emphasis role="bold">Throws</emphasis>: Nothing.</para><para><emphasis role="bold">Rationale</emphasis>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <computeroutput>swap</computeroutput> can be used to emulate move-semantics. </para></description></copy-assignment>
  6071. <destructor><description><para><emphasis role="bold">Effects</emphasis>: If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>normal_link</computeroutput>, the destructor does nothing (ie. no code is generated). If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>safe_link</computeroutput> and the object is stored in an <classname alt="boost::intrusive::unordered_set">unordered_set</classname> an assertion is raised. If <classname alt="boost::intrusive::link_mode">link_mode</classname> is <computeroutput>auto_unlink</computeroutput> and <computeroutput>is_linked()</computeroutput> is true, the node is unlinked.</para><para><emphasis role="bold">Throws</emphasis>: Nothing. </para></description></destructor>
  6072. </class>
  6073. </namespace>
  6074. </namespace>
  6075. </header>
  6076. </library-reference>