diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..2e8708dc --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,14 @@ +# These are supported funding model platforms + +github: [sbarex] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +# patreon: # Replace with a single Patreon username +# open_collective: # Replace with a single Open Collective username +# ko_fi: # Replace with a single Ko-fi username +# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +# liberapay: # Replace with a single Liberapay username +# issuehunt: # Replace with a single IssueHunt username +# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +# polar: # Replace with a single Polar username +buy_me_a_coffee: sbarex # Replace with a single Buy Me a Coffee username +# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.gitignore b/.gitignore index 01866b6a..d41f9d5c 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,4 @@ DerivedData/ .idea/ -._DS_STORE +.DS_Store diff --git a/Application/AboutViewController.swift b/Application/AboutViewController.swift index 2d63d9a0..a02b66ac 100644 --- a/Application/AboutViewController.swift +++ b/Application/AboutViewController.swift @@ -6,16 +6,31 @@ // import Cocoa -import WebKit +@preconcurrency import WebKit class AboutViewController: NSViewController, WKNavigationDelegate { @IBOutlet weak var imageView: NSImageView! @IBOutlet weak var titleField: NSTextField! @IBOutlet weak var versionField: NSTextField! @IBOutlet weak var copyrightField: NSTextField! - @IBOutlet weak var infoWebView: WKWebView! + @IBOutlet weak var hLine: NSBox! + var infoWebView: WKWebView! override func viewDidLoad() { + infoWebView = WKWebView(frame: NSRect.zero) + infoWebView.navigationDelegate = self + infoWebView.translatesAutoresizingMaskIntoConstraints = false + self.view.addSubview(infoWebView) + + NSLayoutConstraint.activate([ + infoWebView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor), + infoWebView.topAnchor.constraint(equalTo: hLine.bottomAnchor), + infoWebView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor), + infoWebView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor), + + infoWebView.heightAnchor.constraint(greaterThanOrEqualToConstant: 200) + ]) + imageView.image = NSApplication.shared.applicationIconImage if let info = Bundle.main.infoDictionary { let version = info["CFBundleShortVersionString"] as? String ?? "" diff --git a/Application/AppDelegate.swift b/Application/AppDelegate.swift index 86e6055b..49079e27 100644 --- a/Application/AppDelegate.swift +++ b/Application/AppDelegate.swift @@ -49,6 +49,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation { isAdvancedSettingsVisible = !isAdvancedSettingsVisible } + func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } + func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply { return SCSHWrapper.shared.applicationShouldTerminate() } @@ -255,11 +259,16 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation { } } + public lazy var CLIURL: URL = { + return URL(fileURLWithPath: utsname.isAppleSilicon ? "/opt/sbarex/syntax_highlight_cli" : "/usr/local/bin/syntax_highlight_cli"); + }() + @IBAction func installCLITool(_ sender: Any) { guard let srcApp = Bundle.main.url(forResource: "syntax_highlight_cli", withExtension: nil) else { return } - let dstApp = URL(fileURLWithPath: "/usr/local/bin/syntax_highlight_cli") + + let dstApp = CLIURL; let alert1 = NSAlert() alert1.messageText = "The tool will be installed in \(dstApp.path) \nDo you want to continue?" @@ -270,6 +279,24 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation { guard alert1.runModal() == .alertFirstButtonReturn else { return } + + /*if !FileManager.default.fileExists(atPath: dstApp.deletingLastPathComponent().path) { + do { + var error: NSDictionary? + NSAppleScript(source: "do shell script \"sudo mkdir -p \(dstApp.deletingLastPathComponent().path)\" with administrator " + "privileges")!.executeAndReturnError(&error) + guard error == nil else { + throw MyShellError.runtimeError(error!.description) + } + } catch { + let alert = NSAlert() + alert.messageText = "Unable to install the command line tool" + alert.informativeText = "(\(error.localizedDescription))\n\nYou can manually install the tool from a Terminal shell with this command: \nln -sfv \"\(srcApp.path)\" \"\(dstApp.path)\"" + alert.alertStyle = .critical + alert.runModal() + return + } + }*/ + guard access(dstApp.deletingLastPathComponent().path, W_OK) == 0 else { let alert = NSAlert() alert.messageText = "Unable to install the tool: \(dstApp.deletingLastPathComponent().path) is not writable" @@ -282,6 +309,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation { let alert = NSAlert() do { + if FileManager.default.fileExists(atPath: dstApp.deletingLastPathComponent().path) { + var error: NSDictionary? + NSAppleScript(source: "do shell script \"sudo mkdir1 -p \(dstApp.deletingLastPathComponent().path)\" with administrator privileges")!.executeAndReturnError(&error) + guard error == nil else { + throw MyShellError.runtimeError(error!.description) + } + } try FileManager.default.createSymbolicLink(at: dstApp, withDestinationURL: srcApp) alert.messageText = "Command line tool installed" alert.informativeText = "You can call it from this path: \(dstApp.path)" @@ -295,7 +329,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation { } @IBAction func revealCLITool(_ sender: Any) { - let u = URL(fileURLWithPath: "/usr/local/bin/syntax_highlight_cli") + let u = CLIURL if FileManager.default.fileExists(atPath: u.path) { // Open the Finder to the settings file. NSWorkspace.shared.activateFileViewerSelecting([u]) @@ -307,5 +341,28 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuItemValidation { alert.runModal() } } + + @IBAction func buyMeACoffee(_ sender: Any?) { + let url = URL(string: "https://www.buymeacoffee.com/sbarex")! + NSWorkspace.shared.open(url) + } +} + +extension utsname { + static var sMachine: String { + var utsname = utsname() + uname(&utsname) + return withUnsafePointer(to: &utsname.machine) { + $0.withMemoryRebound(to: CChar.self, capacity: Int(_SYS_NAMELEN)) { + String(cString: $0) + } + } + } + static var isAppleSilicon: Bool { + sMachine == "arm64" + } } +fileprivate enum MyShellError: Error { + case runtimeError(String) +} diff --git a/Application/CustomTypeViewController.swift b/Application/CustomTypeViewController.swift index 4ec12270..e5d5fb18 100644 --- a/Application/CustomTypeViewController.swift +++ b/Application/CustomTypeViewController.swift @@ -22,6 +22,7 @@ import Cocoa import Syntax_Highlight_XPC_Service +import UniformTypeIdentifiers enum UTISupported { case unknown @@ -64,6 +65,10 @@ class DropSensor: NSView { registerForDraggedTypes(acceptableTypes) } + override func hitTest(_ point: NSPoint) -> NSView? { + return nil + } + override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation { self.dropDelegate?.enterDrag(sender) return .every @@ -223,12 +228,28 @@ class CustomTypeViewController: NSViewController, DropSensorDelegate, NSTableVie } let ext = url.pathExtension - if !ext.isEmpty { - let tags = UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, ext as CFString, nil) - if let t = tags?.takeRetainedValue() as? [String] { - for u in t { - if UTIs.first(where: { $0.UTI.UTI == u }) == nil { - UTIs.append(UTIStatus(UTI: UTI(u), standard: false)) + + if #available(macOS 11.0, *) { + if !ext.isEmpty, let type = UTType(filenameExtension: ext) { + let identifier = type.identifier + + if UTIs.first(where: { $0.UTI.UTI == identifier }) == nil { + UTIs.append( + UTIStatus( + UTI: UTI(identifier), + standard: false + ) + ) + } + } + } else { + if !ext.isEmpty { + let tags = UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, ext as CFString, nil) + if let t = tags?.takeRetainedValue() as? [String] { + for u in t { + if UTIs.first(where: { $0.UTI.UTI == u }) == nil { + UTIs.append(UTIStatus(UTI: UTI(u), standard: false)) + } } } } diff --git a/Application/HighlightWrapper.swift b/Application/HighlightWrapper.swift index 127329f1..1bd4391c 100644 --- a/Application/HighlightWrapper.swift +++ b/Application/HighlightWrapper.swift @@ -8,6 +8,7 @@ import Cocoa import Syntax_Highlight_XPC_Service +import UniformTypeIdentifiers enum HighlightWrapperError: Error { @@ -272,7 +273,11 @@ class HighlightWrapper { let openPanel = NSOpenPanel() openPanel.canCreateDirectories = false openPanel.showsTagField = false - openPanel.allowedFileTypes = ["theme"] + if #available(macOS 11.0, *) { + openPanel.allowedContentTypes = [UTType(filenameExtension: "theme") ?? .data] + } else { + openPanel.allowedFileTypes = ["theme"] + } openPanel.isExtensionHidden = false openPanel.level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(.modalPanelWindow))) diff --git a/Application/Info.plist b/Application/Info.plist index 9fc076ee..34862517 100644 --- a/Application/Info.plist +++ b/Application/Info.plist @@ -33,7 +33,7 @@ LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright - Developed by SBAREX (2019-2024). + Developed by SBAREX (2019-2026). NSMainStoryboardFile Storyboard NSPrincipalClass @@ -88,6 +88,22 @@ + + UTTypeConformsTo + + public.xml + dyn.ah62d4rv4ge8048drru + + UTTypeIdentifier + com.adobe.mxml + UTTypeTagSpecification + + com.apple.ostype + + mxml + + + UTTypeConformsTo @@ -107,6 +123,23 @@ + + UTTypeConformsTo + + dyn.ah62d4rv4ge81a65nsq + dyn.age81a65nsq + public.javascript + + UTTypeIdentifier + com.adobe.psjs + UTTypeTagSpecification + + public.filename-extension + + js + + + UTTypeConformsTo @@ -124,6 +157,23 @@ + + UTTypeConformsTo + + public.c-plus-plus-source + public.source-code + dyn.ah62d4rv4ge80g7k + + UTTypeIdentifier + com.nvidia.cuda + UTTypeTagSpecification + + public.filename-extension + + cu + + + UTTypeConformsTo @@ -192,6 +242,26 @@ + + UTTypeDescription + Rexx source file + UTTypeConformsTo + + public.item + dyn.ah62d4rv4ge81e3p2ta + dyn.ah62d4rv4ge81e3p2 + + UTTypeIdentifier + com.ibm.rexx + UTTypeTagSpecification + + public.filename-extension + + rexx + rex + + + UTTypeConformsTo @@ -210,6 +280,24 @@ + + UTTypeConformsTo + + public.source-code + dyn.ah62d4rv4ge8046my + dyn.ah62d4rv4ge8046mz + + UTTypeIdentifier + com.metatrader.mq + UTTypeTagSpecification + + public.filename-extension + + mq4 + mq5 + + + UTTypeConformsTo @@ -245,6 +333,40 @@ + + UTTypeDescription + Visual Studio C# Project + UTTypeConformsTo + + dyn.ah62d4rv4ge80g65usm10y + public.xml + + UTTypeIdentifier + com.microsoft.csproj + UTTypeTagSpecification + + public.filename-extension + + csproj + + + + + UTTypeConformsTo + + dyn.ah62d4rv4ge80k8xm + public.xml + + UTTypeIdentifier + com.microsoft.dzi + UTTypeTagSpecification + + public.filename-extension + + dzi + + + UTTypeConformsTo @@ -405,6 +527,8 @@ + UTTypeDescription + Stata source file UTTypeConformsTo public.item @@ -507,6 +631,26 @@ + UTTypeDescription + Unity document + UTTypeConformsTo + + public.plain-text + dyn.ah62d4rv4ge81n5xmsv6u + + UTTypeIdentifier + com.unity.document + UTTypeTagSpecification + + public.filename-extension + + unity + + + + + UTTypeDescription + Astro source files UTTypeConformsTo public.item @@ -522,6 +666,25 @@ + + UTTypeDescription + Nix Expression Language + UTTypeConformsTo + + public.data + public.item + dyn.ah62d4rv4ge8064p2 + + UTTypeIdentifier + dev.nix.source + UTTypeTagSpecification + + public.filename-extension + + nix + + + UTTypeConformsTo @@ -578,6 +741,8 @@ + UTTypeDescription + Nextflow files UTTypeConformsTo dyn.ah62d4rv4ge8063u @@ -594,11 +759,14 @@ + UTTypeDescription + Terraform files UTTypeConformsTo dyn.ah62d4rv4ge81k3x0qf3hg dyn.ah62d4rv4ge81k3u dyn.ah62d4rv4ge80u25q + dyn.ah62d4rv4ge81k3xxsvu1k3 public.item UTTypeIdentifier @@ -607,6 +775,7 @@ public.filename-extension + tfstate tf tfvars hcl @@ -716,6 +885,25 @@ + + UTTypeConformsTo + + dyn.ah62d4rv4ge80e2u + org.clojure.script + public.source-code + public.plain-text + public.text + + UTTypeIdentifier + org.babashka.source + UTTypeTagSpecification + + public.filename-extension + + bb + + + UTTypeConformsTo @@ -735,6 +923,8 @@ + UTTypeDescription + Bazel source file UTTypeConformsTo public.item @@ -844,6 +1034,8 @@ + UTTypeDescription + Crystal source file UTTypeConformsTo public.item @@ -930,6 +1122,24 @@ + + UTTypeDescription + XML Font Tool file + UTTypeConformsTo + + dyn.ah62d4rv4ge81k7d2 + public.xml + + UTTypeIdentifier + org.fonttools.ttx + UTTypeTagSpecification + + public.filename-extension + + ttx + + + UTTypeConformsTo @@ -1028,6 +1238,54 @@ + + UTTypeConformsTo + + public.item + dyn.ah62d4rv4ge81g25q + + UTTypeIdentifier + org.huygens-fokker.scala + UTTypeTagSpecification + + public.filename-extension + + scl + + + + + UTTypeConformsTo + + public.xml + dyn.ah62d4rv4ge806252 + + UTTypeIdentifier + org.idpf.ncx + UTTypeTagSpecification + + public.filename-extension + + ncx + + + + + UTTypeConformsTo + + public.xnl + dyn.ah62d4rv4ge8086dg + + UTTypeIdentifier + org.idpf.opf + UTTypeTagSpecification + + public.filename-extension + + opf + + + UTTypeConformsTo @@ -1082,6 +1340,22 @@ + + UTTypeConformsTo + + dyn.ah62d4rv4ge80y65tr24u + public.json + + UTTypeIdentifier + org.json5.json5 + UTTypeTagSpecification + + public.filename-extension + + json5 + + + UTTypeConformsTo @@ -1098,6 +1372,24 @@ + + UTTypeDescription + Jupyter Notebook + UTTypeConformsTo + + public.json + dyn.ah62d4rv4ge80w6d3r3va + + UTTypeIdentifier + org.jupyter.ipynb + UTTypeTagSpecification + + public.filename-extension + + ipynb + + + UTTypeConformsTo @@ -1132,6 +1424,24 @@ + + UTTypeConformsTo + + dyn.ah62d4rv4ge8007a + + UTTypeDescription + Kotlin Source File + UTTypeIdentifier + org.kotlinlang.kotlin-source + UTTypeTagSpecification + + public.filename-extension + + kts + kt + + + UTTypeConformsTo @@ -1170,6 +1480,8 @@ + UTTypeDescription + Lilypond source file UTTypeConformsTo public.item @@ -1182,6 +1494,7 @@ public.filename-extension ly + ily @@ -1203,6 +1516,24 @@ + + UTTypeDescription + MAMEdev layout file + UTTypeConformsTo + + public.xml + dyn.ah62d4rv4ge8022p3 + + UTTypeIdentifier + org.mamedev.lay + UTTypeTagSpecification + + public.filename-extension + + lay + + + UTTypeConformsTo @@ -1220,6 +1551,22 @@ + + UTTypeConformsTo + + dyn.ah62d4rv4ge80462 + public.item + + UTTypeIdentifier + org.miniscript.ms + UTTypeTagSpecification + + public.filename-extension + + ms + + + UTTypeConformsTo @@ -1453,6 +1800,11 @@ public.filename-extension scm + ss + sls + sps + sld + sch @@ -1621,6 +1973,25 @@ + + UTTypeConformsTo + + dyn.ah62d4rv4ge81g25bqu + public.c-plus-plus-source + public.source-code + public.plain-text + public.text + + UTTypeIdentifier + org.openscad.source + UTTypeTagSpecification + + public.filename-extension + + scad + + + UTTypeConformsTo @@ -1691,6 +2062,22 @@ + + UTTypeConformsTo + + public.plain-text + dyn.ah62d4rv4ge81e2prru + + UTTypeIdentifier + org.raml.raml + UTTypeTagSpecification + + public.filename-extension + + raml + + + UTTypeConformsTo @@ -1927,11 +2314,14 @@ sc sbt + mill scala + UTTypeDescription + Smali source file UTTypeConformsTo public.item @@ -1963,6 +2353,25 @@ + + UTTypeDescription + OpenType feature syntax + UTTypeConformsTo + + public.text + public.data + dyn.ah62d4rv4ge80q3pb + + UTTypeIdentifier + org.unifiedfontobject.fea + UTTypeTagSpecification + + public.filename-extension + + fea + + + UTTypeConformsTo @@ -1998,6 +2407,25 @@ + + UTTypeConformsTo + + dyn.ah62d4rv4ge81e55cr74g8 + public.text + public.source-code + + UTTypeDescription + Robot Framework File + UTTypeIdentifier + org.robotframework.robot + UTTypeTagSpecification + + public.filename-extension + + robot + + + UTTypeConformsTo @@ -2017,6 +2445,8 @@ UTTypeConformsTo + public.xsd + public.xml public.item dyn.ah62d4rv4ge81u6pzqz3hw dyn.ah62d4rv4ge81u6k @@ -2040,6 +2470,8 @@ UTTypeConformsTo + public.xsd + publix.xml public.item dyn.ah62d4rv4ge81u65e @@ -2514,6 +2946,24 @@ + + UTTypeDescription + JSON Canvas + UTTypeConformsTo + + public.json + dyn.ah62d4rv4ge80g2pss3u1g + + UTTypeIdentifier + org.jsoncanvas.canvas + UTTypeTagSpecification + + public.filename-extension + + canvas + + + UTTypeConformsTo @@ -2785,6 +3235,23 @@ text/x-gdscript + + UTTypeConformsTo + + public.source-code + public.plain-text + public.text + + UTTypeIdentifier + run.gleam.source + UTTypeTagSpecification + + public.filename-extension + + gleam + + + UTTypeDescription Python Bytecode Document diff --git a/Application/PlainSettingsView.xib b/Application/PlainSettingsView.xib index 38cfa3c9..5a0d8b8d 100644 --- a/Application/PlainSettingsView.xib +++ b/Application/PlainSettingsView.xib @@ -1,8 +1,8 @@ - + - + @@ -285,13 +285,13 @@ - + @@ -241,8 +246,8 @@ - - + + @@ -260,7 +265,7 @@ - + @@ -305,7 +310,7 @@ - - + + @@ -354,7 +359,7 @@ + + + + + If enabled allow javascript on the preview but disable the click and drag window and also doubleclick to open file. Enable only if you use a highlight plugin that require some js code in the output. + + + + + - - + + @@ -525,7 +551,7 @@ - - + + @@ -550,7 +576,7 @@ - - + + @@ -343,13 +342,13 @@ DQ - + - + - + @@ -373,7 +372,7 @@ DQ - - + + - - + + @@ -558,21 +557,21 @@ Gw - - + + @@ -582,8 +581,8 @@ Gw - - + + @@ -655,7 +654,7 @@ Gw - + @@ -684,9 +683,14 @@ Gw + + + + + - + @@ -702,6 +706,7 @@ Gw + @@ -1008,6 +1013,12 @@ Gw + + + + + + @@ -1045,13 +1056,13 @@ Gw - + - + - + @@ -1071,15 +1082,15 @@ Gw - + - + @@ -1090,7 +1101,7 @@ Gw - + @@ -1159,11 +1170,11 @@ Gw - + - - + + @@ -1171,7 +1182,7 @@ Gw - + @@ -1189,16 +1200,16 @@ Gw - - + + - - + + @@ -1212,14 +1223,14 @@ Gw - + - + + + - - + - - + - + - - + @@ -1433,7 +1443,7 @@ Gw - + @@ -1522,7 +1532,7 @@ Gw - + @@ -1573,7 +1583,7 @@ Gw - + - + - + - + @@ -1622,12 +1632,12 @@ DQ - + - + @@ -1645,9 +1655,9 @@ DQ - + - + @@ -1656,7 +1666,7 @@ DQ - + - + - + @@ -1773,7 +1783,7 @@ DQ - + @@ -1791,7 +1801,7 @@ DQ - + @@ -1921,8 +1931,8 @@ DQ - - + + @@ -1934,7 +1944,7 @@ DQ - + @@ -1957,7 +1967,7 @@ DQ - + @@ -1982,7 +1992,7 @@ DQ - + @@ -2044,7 +2054,7 @@ DQ - - + + @@ -2128,7 +2138,7 @@ Gw - + @@ -2161,7 +2171,7 @@ Gw - + @@ -2194,7 +2204,7 @@ Gw - + @@ -2227,7 +2237,7 @@ Gw - + @@ -2252,7 +2262,7 @@ Gw - + NSHumanReadableCopyright - Developed by SBAREX (2019-2024). + Developed by SBAREX (2019-2026). diff --git a/QLExtension/PreviewViewController.swift b/QLExtension/PreviewViewController.swift index c386d4bb..b524c9b8 100644 --- a/QLExtension/PreviewViewController.swift +++ b/QLExtension/PreviewViewController.swift @@ -79,6 +79,16 @@ class PreviewViewController: NSViewController, QLPreviewingController, WKNavigat var textScrollView: NSScrollView? var textView: NSTextView? var webView: WKWebView? + var appearanceObserver: NSKeyValueObservation? + + /// Check if the appearance is Dark + lazy var isDarkMode: Bool = { + // fixme: nell'estensione non sempre restituisce il valore aggiornato! + if let appearance = self.view.effectiveAppearance.bestMatch(from: [.darkAqua, .aqua]) { + return appearance == .darkAqua + } + return false + }() lazy var connection: NSXPCConnection = { let connection = NSXPCConnection(serviceName: "org.sbarex.SourceCodeSyntaxHighlight.XPCRender") @@ -105,12 +115,20 @@ class PreviewViewController: NSViewController, QLPreviewingController, WKNavigat view.layer?.borderWidth = 0 } + self.appearanceObserver = NSApp.observe(\.effectiveAppearance, options: [.new, .old, .initial, .prior]) { app, change in + self.isDarkMode = change.newValue?.bestMatch(from: [.darkAqua, .aqua]) == .darkAqua + } + + self.textView?.linkTextAttributes = [:] + DistributedNotificationCenter.default().addObserver(self, selector: #selector(self.handleSettingsChanged(_:)), name: .SettingsUpdated, object: nil) } deinit { self.connection.invalidate() DistributedNotificationCenter.default().removeObserver(self, name: .SettingsUpdated, object: nil) + self.appearanceObserver?.invalidate() + self.appearanceObserver = nil } /// Reload settings after they have been changed in the main app. @@ -138,7 +156,7 @@ class PreviewViewController: NSViewController, QLPreviewingController, WKNavigat var handler: ((Error?) -> Void)? = nil func preparePreviewOfFile(at url: URL, completionHandler handler: @escaping (Error?) -> Void) { - // This code will not be called on macOS 12 Monterey with QLIsDataBasedPreview set. + // This code will *not* be called on macOS 12 Monterey with QLIsDataBasedPreview set. // Add the supported content types to the QLSupportedContentTypes array in the Info.plist of the extension. diff --git a/QLExtension/QLExtension.entitlements b/QLExtension/QLExtension.entitlements index 866ec39d..1e81cf4b 100644 --- a/QLExtension/QLExtension.entitlements +++ b/QLExtension/QLExtension.entitlements @@ -2,12 +2,16 @@ - com.apple.security.get-task-allow - com.apple.security.app-sandbox + com.apple.security.application-groups + + group.org.sbarex.syntaxhighlight + com.apple.security.files.user-selected.read-only + com.apple.security.get-task-allow + com.apple.security.network.client com.apple.security.temporary-exception.mach-lookup.global-name diff --git a/README.md b/README.md index cf3d67e9..b8f318e7 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,24 @@ [![counter](https://img.shields.io/github/downloads/sbarex/SourceCodeSyntaxHighlight/latest/total)](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases) [![counter](https://img.shields.io/github/downloads/sbarex/SourceCodeSyntaxHighlight/total)](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases) +[![buy me a coffee](https://img.buymeacoffee.com/button-api/?text=Buy+me+a+coffee&emoji=&slug=sbarex&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff")](https://www.buymeacoffee.com/sbarex) + +

logo

# Syntax Highlight -The application offers a Quick Look Extension for macOS 10.15 Catalina and later for previewing source files. -Inside it uses [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php) to render source code with syntax highlighting. +The application offers a Quick Look Extension for macOS 12.0 and later for previewing source files. +Inside it uses [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php) to render source code with syntax highlighting. (For macOS 11 and 10.15, the latest compatible version is 2.1.30). > **`Syntax Highlight` is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY.** +If you like this application and find it useful, [buy me a coffee](https://www.buymeacoffee.com/sbarex)! + - [Installation](#installation) - [Download precompiled release](#download-precompiled-release) - - [Install with Homebrew Cask](#install-with-homebrew-cask) + - [Install with Homebrew](#install-with-homebrew) - [Note for the precompiled release](#note-for-the-precompiled-release) - [Build from source](#build-from-source) - [Enable the Quick Look extension](#enable-the-quick-look-extension) @@ -32,6 +37,7 @@ Inside it uses [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight - [Known bugs](#known-bugs) - [Note for developers](#note-for-developers) - [Info about decoding dynamic UTI identifiers](#info-about-decoding-dynamic-uti-identifiers) + - [Other useful links](#other-useful-links) - [Credits](#credits) @@ -44,27 +50,16 @@ After installation, _the application must be launched at least once to allow the ### Download precompiled release Head over to the [releases](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases) page to view the latest version. Move `Syntax Highlight.app` into the `Applications` folder. -### Install with Homebrew Cask -Syntax Highlight can also be installed via [Homebrew Cask](https://github.com/Homebrew/homebrew-cask). If you have not installed Homebrew, follow the simple instructions [here](https://brew.sh/). After that, install the current version of Syntax Highlight with the following command: +### Install with Homebrew +Syntax Highlight can also be installed via [Homebrew](https://brew.sh). If you have not installed Homebrew, follow the simple instructions [here](https://brew.sh/). After that, install the current version of Syntax Highlight with the following command: ```bash -brew install --cask --no-quarantine syntax-highlight +brew install syntax-highlight ``` ### Note for the precompiled release -The [precompiled app](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases) is not notarized or signed, so the first time you run the app the system may show a warning about the impossibility to check for malicious software. - -To fix, you can launch the app with right-click (or Control-click) on the app icon and choose the open action. - -You can also execute this command from the terminal: - -```bash -xattr -r -d com.apple.quarantine "FULL PATH OF Syntax Highlight.app (you can drag the file to get the pull path)" -``` - -Alternatively, after trying to launch the app for the first time, you can open the `System Preferences > Security & Privacy > General (tab)` and click the `Open Anyway` button. +The [precompiled app](https://github.com/sbarex/SourceCodeSyntaxHighlight/releases) is codesigned and notarized. -This will resolve the error of an unsigned application when launching the app. ### Build from source @@ -85,19 +80,6 @@ _To use the Quick Look preview you must launch the Application at least once._ I ![System preferences/Extensions](assets/extensions.png) -When opening the app _for the first time_, you may see a pop-up warning about unable to check malicious software. - -To fix follow these steps: - -- Switch to Finder and navigate to the application. -- Right-click (or Control-click) `Syntax Highlight.app` and choose the `Open` item from the contextual menu. -- A modal popup appears stating: - > "Syntax Highlight.app" can’t be opened because Apple cannot check it for malicious software. -- Click `Open` to confirm. - -This warning is because the app is neither codesigned nor notarized. - -For more info see the [note for the precompiled release](#note-for-the-precompiled-release). ## File format management @@ -120,16 +102,20 @@ The application can also handle some [plain files](#plain-files) **without exten - Ada (`.ada`) - Adobe Acrobat Sequence files (`.sequ`) _as `XML`_ - Adobe Flash ActionScript source files (`.as`) +- Adobe Flex files (`.mxml`) files _as `XML`_ - Adobe JSX script files (`.jsx`) +- Adobe UPX Javascript (`.psjs`) +- Apple loctable (`.loctable`) _as `plist (XML)`_ - Apple workflow (`.wflow`) _as `plist (XML)`_ - AppleScript (`.scpt`, `.applescript`, `.ascr`) _automatically decompiled with `osadecompile`_ - Apple shell script files (`.command`) - Assembler source files (`.asm`, `.s79`) -- Astro files (`.astro`) _as JSX_. +- Astro files (`.astro`) _as `JSX`_. - Autolit files (`.au3`, `.a3x`) - Azkaban flow files (`.flow`) as _`YAML`_ - ATL files (`.atl`) - (G)AWK files (`.awk`) +- Babashka (`.bb`) files _as `Clojure`_. - Bash Script files (`.bash`) - Bezel (`.bezel`) as _plain text_ - BibTex (`.bib`) @@ -147,8 +133,10 @@ The application can also handle some [plain files](#plain-files) **without exten - Crystal language (`.cr`) - CSON source files (`.cson`) - CSS files (`.css`) +- Cuda files (`.cu`) _as `C++`_ - D (`.d`) - Dart source files (`.dart`) **`.dart` is reserved by macOS and cannot be handled.** +- Designspace files (`.designspace`) _as `XML`_ - Diff files (`.diff`, `.patch`) - Dockerfile (`.dockerfile`) - Document Type Definition (`.dtd`) @@ -157,14 +145,21 @@ The application can also handle some [plain files](#plain-files) **without exten - ECore files (`.ecore`) - Eiffel project files (`.ecf`) _as `XML`_ - Eiffel source files (`.e`, `.ex`, `.exs`) +- Elixir files (`.ex`, `.exs`, `.heex`) +- Enviroment files (`.env`) _as `INI`_ +- ePub [Navigation Center eXtended](https://idpf.org/epub/20/spec/OPF_2.0_latest.htm#Section2.4.1) (`.ncx`) _as XML_. +- ePub [Open Packaging Format](https://idpf.org/epub/20/spec/OPF_2.0_latest.htm) (`.opf`) files _as XML_. - Erlang source files (`.erl`, `.hri`) - F# source files (`.fsx`, `.fs`) - fish source files (`.fish`) +- FonTool files (`.ttx`) _as `XML`_. - Fortran source files (`.f`, `.for`, `.f90`, `.f95`) - GCC linked files (`.ld`, `.map`, `.d`) - Gdscript (Godot engine) (`.gd`). +- Gleam (`.gleam`) - Golang source files (`.go`) - Google Earth KML Document files (`.kml`) _as `XML`_ +- GPS eXchange Format) (`.gpx`) _as `XML`_ - Gradle source files (`.gradle`) - Graphics Language Transmission Format (`.gltf`) _as `JSON`_ - Groovy source files (`.groovy`) @@ -185,30 +180,40 @@ The application can also handle some [plain files](#plain-files) **without exten - Java Web Start (`.jnlp`) - JavaFX ML (`.fxml`) - JavaScript files (`.js`, `.jscript`, `.javascript`, `.mjs`, `.jsm`) -- JSON files (`.json`, `.jsonc`) ** On macOS 13 Ventura with Apple Silicon the `.json` extension is reserved by the system and cannot be handled.** +- JSON files (`.json`, `.jsonc`, `.json5`) ** On macOS 13 Ventura with Apple Silicon the `.json` extension is reserved by the system and cannot be handled.** +- JSON Canvas (`.canvas`) _as `JSON`_ - JSON Line files (`.jsonl`) _as `JSON`_ - Julia source files (`.jl`) +- Jupyter Notebook files (`.ipynb`) _as `JSON`_ - Kermeta source files (`.kmt`) - Korn Shell script files (`.ksh`) - Kotlin source files (`.kt`, `.kts`) - LESS stylesheet (`.less`) -- Lilypond files (`.ly`)x1 +- Lilypond files (`.ly`, `.ily`) - Lisp source files (`.lisp`, `.lsp`, `.asd`, `.el`) - Logos source files (`.xm`) - Lua source files (`.lua`) - Makefile files (`.mk`, `.mak`) +- MAMEdev layout files (`.lay`) _as `XML`_. - Markdown files (`.md`, `.rmd`): _please use [QLMarkdown](https://github.com/sbarex/QLMarkdown)_ which allows you to choose whether to display formatted output or the highlighted source code. -- Media Presentation Description (`.mpd`) _as XML_. +- Media Presentation Description (`.mpd`) _as `XML`_. +- MetaTrader (`.mq4`, `.mq5`) files _as CPP_. - MF source files (`.mf`) - Microsoft Active Server Page files (`.asp`, `.aspx`) - Microsoft PowerShell files (`.psm1`, `.psd1`, `.ps1`) -- NextFlow (`.nf`) _as Groovy (Java)_ +- Microsoft Visual Studio C# Project (`.csproj`) _as `XML`_ +- [MiniScript](https://miniscript.org/) files (`.ms`) +- NextFlow (`.nf`) _as `Groovy (Java)`_ - Nim source files (`.nim`) +- Nix Expression Language (`.nix`) - Node CommonJS module (`.cjs`) - Objective-C source files (`.m`) - Objective-C++ source files (`.mm`) - OCaml source files (`.ml`, `.mll`, `.mly`) +- OpenSCAD files (`.scad`) _as `CPP`_. - OpenSSH RSA public key (`.pub`) _as plain text_ +- OpenTimelineIO files (`.otio`) _as JSON_ +- OpenType feature file specification (`.fea`) - OPML (Outline Processor Markup Language) files (`.opml`) _as `XML`_ - Oracle PL/SQL files (`.fnc`, `.prc`, `.trg`, `.pks`, `.pkb`, `.pck`, `.tps`, `.tpb`, `.typ`, `.tab`, `.avt`, `.con`, `.sqs`, `.vw`, `.mvw`, `.trg`) _as `SQL`_ - Paradox files (`.sc`) @@ -218,15 +223,19 @@ The application can also handle some [plain files](#plain-files) **without exten - Perl script files (`.pl`, `.pm`, `.t`) - Planning Domain Description Language (`.pddl`) _as `Lisp`_ - PHP source files (`.php`, `.php3`, `.php4`, `.ph3`, `.ph4`, `.phtml`) +- Project Object Model files (`.pom`) _as XML_ - Properties files (`.properties`) _as `INI`_ - Property List files (`.plist`) _dynamically decompiled with `plutil`_ **On macOS 10.15 Catalina `.plist` is reserved by the system and cannot be handled.** -- Python source files (`.py`) +- Python source files (`.py`, `.py3`, `.pyi`) - R (`.r`) - Racket (`.rkt`) _as `Lisp`_ +- RAML (`.raml`) _as `YAML`_ +- Rexx (`.rex`, `.rexx`) - RDF files (`.rdf`) - README files (`.readme`) _as plain text_ - reStructuredText document (`.rst`) - Rez files (`.r`) +- Robot framework (`.robot`) _as `python`_. - Ruby on Rails files (`.rhtml`, `.erb`, `.rjs`) - Ruby Gems file (`.gemfile`) - Ruby script (`.rb`, `.rbw`) @@ -234,8 +243,9 @@ The application can also handle some [plain files](#plain-files) **without exten - SageMath files (`.sage`) _as `Python`_ - SAS files (`.sas`) - SASS/SCSS files (`.scss`) -- Scala source files (`.sc`, `.sbt`, `.scala`) -- Scheme source files (`.scm`) +- Scala source files (`.sc`, `.sbt`, `.scala`, `.mill`) +- [Scala scale file format](https://huygens-fokker.org/scala/scl_format.html) (`.scl`) _as plain text_ +- Scheme source files (`.scm`, `.ss`, `.sls`, `.sps`, `.sld`, `.sch`) _as `Lisp`_ - Shell script files (`.bashrc`, `.zshrc`, `.sh`) - Smali (`.smali`) _as plain text_. - Solidity source files (`.sol`) @@ -243,31 +253,36 @@ The application can also handle some [plain files](#plain-files) **without exten - Standard ML source files (`.ml`) - Stata files (`.do`, `.ado`) _as plain text_ - Steam app manifest files (`.acf`) _as plain text_. -- Svelte (`.svelte`) _as `HTML`_ +- Svelte (`.svelte`) - Swift source files (`.swift`) - Symfony Twig files (`.twig`) - TCL source files (`.tcl`) - Tenex C Shell script files (`.tcsh`) -- Terraform files (`.tfvars`, `.tf`, `.hcl`) _as `YAML`_ +- Terraform files (`.tfvars`, `.tfstate`, `.tf`, `.hcl`) _as `YAML`_ - TeX and LaTeX files (`.tex`, `.sty`, `.cls`, `.latex`, `.ltx`, `.texi`, `.ctx`, `.sty`) - Text files (`.txt`, `.text`) - TOML files (`.toml`) - TypeScript files (`.ts`, `.tsx`, `.cts`, `.mts`) **`.ts` and `.mts` are reserved by macOS and cannot be handled.** -- Visual Studio Code Workspace (`.code-workspace`) _ as `JSON`_ +- Unity document (`.unity`) _as `YAML`_ +- Visual Studio Code Workspace (`.code-workspace`) _as `JSON`_ - Verilog HDL files (`.v`, `.vl`) - VHDL source files (`.vhd`, `.vhdl`) - VIM script files (`.vim`) - Visual Basic source files (`.vb`, `.bas`, `.basic`, `.vbs`) - Vue source files (`.vue`) -- XAML source files (`.xaml`) _as XML_ -- Xcode entitlement files (`.entitlements`) (dynamically decompiled with `plutil`) _as XML_ -- Xcode localizable strings files (`.strings`, `.stringsdict`) (dynamically decompiled with `plutil`) _as XML_ +- XAML source files (`.xaml`) _as `XML`_ +- Xcode entitlement files (`.entitlements`) (dynamically decompiled with `plutil`) _as `XML`_ +- Xcode localizable strings files (`.strings`, `.stringsdict`) (dynamically decompiled with `plutil`) _as `XML`_ +_ Xcode scheme _as `XML`_ - XHTML files (`.xhtml`) - XML files (`.xml`) **Before macOS 12 Monterey `.xml` is reserved by the system and cannot be handled.** - XSD Schema files (`.xsd`, `.xquery`, `.xq`, `.xu`) - XUL files (`.xul`) - YAML files (`.yaml`) - Z shell script files (`.zsh`) +- Zig source files (`.zig`) +- Zig Object Notation files (`.zon`) _as JSON_. + ## Application settings @@ -299,6 +314,7 @@ You can set the settings for all supported formats on the _General_ tab. |Convert line ending| Allow to convert Windows (`CRLF`) and Mac Classic (`CR`) line ending to the Unix style (`LN`). This option is ignored when a _preprocessor_ is set or when a _Language Server_ is enabled. The line ending conversion is made my [`dos2unix`](https://waterlan.home.xs4all.nl/dos2unix.html). |Yes| |VCS Support| If enabled, allow to highlight lines added/edited/removed from last commit. It can handle VCS based on `git` and `mercurial`. |Yes| |Custom Quick Look size|Allow you to choose a custom size for the content area of the Quick Look window. _Use with caution on macOS before version 12 Monterey_.|| +|Show about info | If enabled, shows information about this application at the bottom of the preview page.|Yes| |Debug | If enabled, a `colorize.log` and `colorize.rtf\|html` file will be created on your Desktop folder with the log of last rendering.|Yes| You can also override the global options for some formats on the _Formats_ tab. @@ -423,7 +439,7 @@ The tool is located inside the `Syntax Highlight.app/Contents/Resources` folder From the Application menu you can create a symbolic link into `/usr/local/bin` folder. ```bash -/Application/Syntax\ Highlight.app/Contents/Resources/syntax_highlight_cli -h +/Applications/Syntax\ Highlight.app/Contents/Resources/syntax_highlight_cli -h ``` ``` Usage: syntax_highlight_cli [-o ] [..] @@ -483,8 +499,6 @@ The CLI interface uses the same settings as the Quick Look extension, but you ca The highlighted data is printed to the `stdout` or writed to file if you use the `-o` option. -The command line tool require macOS 10.15.4 or later. - ## Add support to a custom format @@ -572,7 +586,7 @@ The application embed the [`Highlight`](http://www.andre-simon.de/doku/highlight ![highlight info](assets/about_highlight.png) -### Info about decoding dynamic UTI identifiers: +### Info about decoding dynamic UTI identifiers - https://gist.github.com/jtbandes/19646e7457208ae9b1ad - https://alastairs-place.net/blog/2012/06/06/utis-are-better-than-you-think-and-heres-why/ @@ -644,6 +658,19 @@ pluginkit -mAvvv -p com.apple.quicklook.preview pluginkit -m -v -i org.sbarex.SourceCodeSyntaxHighlight.QuickLookExtension --raw ``` +### Other useful links + +https://eclecticlight.co/2024/11/04/how-does-quicklook-create-thumbnails-and-previews-with-an-update-to-mints/ + +https://eclecticlight.co/2024/11/02/a-brief-history-of-icons-thumbnails-and-quicklook/ + +https://eclecticlight.co/2024/10/31/how-sequoia-has-changed-quicklook-and-its-thumbnails/ + +https://mjtsai.com/blog/2024/11/05/sequoia-no-longer-supports-quicklook-generator-plug-ins/ + +https://eclecticlight.co/2025/10/25/explainer-how-does-macos-recognise-file-types/ + + ## Credits Developed by [sbarex](https://github.com/sbarex) with :heart:. @@ -652,3 +679,5 @@ Highlight is developed by [Andre Simon](http://www.andre-simon.de/). Dos2unix is developed by [Erwin Waterlander](https://waterlan.home.xs4all.nl/dos2unix.html). This application was inspired by [anthonygelibert/QLColorCode](https://github.com/anthonygelibert/QLColorCode) and [NSGod/qlstephen](https://github.com/NSGod/qlstephen). + +If you find this application useful, [buy me a coffee](https://www.buymeacoffee.com/sbarex). diff --git a/Resources/qlsource.icon/Assets/ql_eye.svg b/Resources/qlsource.icon/Assets/ql_eye.svg new file mode 100644 index 00000000..ddb13ad2 --- /dev/null +++ b/Resources/qlsource.icon/Assets/ql_eye.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/Resources/qlsource.icon/Assets/source_code.svg b/Resources/qlsource.icon/Assets/source_code.svg new file mode 100644 index 00000000..5bd5477f --- /dev/null +++ b/Resources/qlsource.icon/Assets/source_code.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/qlsource.icon/icon.json b/Resources/qlsource.icon/icon.json new file mode 100644 index 00000000..fe392831 --- /dev/null +++ b/Resources/qlsource.icon/icon.json @@ -0,0 +1,66 @@ +{ + "fill" : "automatic", + "groups" : [ + { + "layers" : [ + { + "fill" : "automatic", + "image-name" : "source_code.svg", + "name" : "source_code", + "position-specializations" : [ + { + "idiom" : "square", + "value" : { + "scale" : 1.25, + "translation-in-points" : [ + 0, + 0 + ] + } + } + ] + }, + { + "blend-mode" : "normal", + "fill" : { + "automatic-gradient" : "extended-srgb:1.00000,0.23137,0.18824,1.00000" + }, + "glass" : true, + "hidden-specializations" : [ + { + "idiom" : "macOS", + "value" : false + } + ], + "image-name" : "ql_eye.svg", + "name" : "ql_eye", + "position-specializations" : [ + { + "idiom" : "square", + "value" : { + "scale" : 1.25, + "translation-in-points" : [ + 0, + 0 + ] + } + } + ] + } + ], + "shadow" : { + "kind" : "neutral", + "opacity" : 0.5 + }, + "translucency" : { + "enabled" : true, + "value" : 0.5 + } + } + ], + "supported-platforms" : { + "squares" : [ + "macOS" + ] + } +} \ No newline at end of file diff --git a/ShortcutCommand/Info.plist b/ShortcutCommand/Info.plist new file mode 100644 index 00000000..8d15acbe --- /dev/null +++ b/ShortcutCommand/Info.plist @@ -0,0 +1,11 @@ + + + + + EXAppExtensionAttributes + + EXExtensionPointIdentifier + com.apple.appintents-extension + + + diff --git a/ShortcutCommand/Localizable.xcstrings b/ShortcutCommand/Localizable.xcstrings new file mode 100644 index 00000000..ae10432a --- /dev/null +++ b/ShortcutCommand/Localizable.xcstrings @@ -0,0 +1,136 @@ +{ + "sourceLanguage" : "en", + "strings" : { + "Engine" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Motore di formattazione" + } + } + } + }, + "Generate debug log" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Genera file di log" + } + } + } + }, + "Highlight source code of ${inputFile} to a ${engine} file." : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Formatta il codice sorgente di${inputFile} in un file ${engine}." + } + } + } + }, + "HTML" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "HTML" + } + } + } + }, + "Input File" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "File" + } + } + } + }, + "Option engine" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Opzione del motore di formattazione" + } + } + } + }, + "predefined" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "predefinito" + } + } + } + }, + "RTF" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "RTF" + } + } + } + }, + "Save log to ~/Desktop/colorize.log" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Salva un file di log in ~/Scrivania/colorize.log" + } + } + } + }, + "Syntax Highlight source file" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Evidenzia la sintassi del codice sorgente" + } + } + } + }, + "Syntax Highlights the source code of a file." : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Evidenzia la sintassi del codice sorgente di un file" + } + } + } + }, + "The rendering engine." : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Motore di formattazione." + } + } + } + }, + "The source file to hightlights." : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "File sorgente da formattare." + } + } + } + } + }, + "version" : "1.0" +} \ No newline at end of file diff --git a/ShortcutCommand/ShortcutCommand.entitlements b/ShortcutCommand/ShortcutCommand.entitlements new file mode 100644 index 00000000..5f06052b --- /dev/null +++ b/ShortcutCommand/ShortcutCommand.entitlements @@ -0,0 +1,40 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.application-groups + + group.org.sbarex.syntaxhighlight + + com.apple.security.assets.movies.read-only + + com.apple.security.assets.music.read-only + + com.apple.security.assets.pictures.read-only + + com.apple.security.files.downloads.read-only + + com.apple.security.files.user-selected.read-only + + com.apple.security.network.client + + com.apple.security.temporary-exception.files.absolute-path.read-only + + / + + com.apple.security.temporary-exception.files.home-relative-path.read-write + + /Desktop + /Desktop/colorize.html + /Desktop/colorize.log + /Desktop/colorize.rtf + /Library/Application Support/Syntax Highlight/Themes/ + + com.apple.security.temporary-exception.shared-preference.read-only + + org.sbarex.SourceCodeSyntaxHighlight + + + diff --git a/ShortcutCommand/ShortcutCommand.swift b/ShortcutCommand/ShortcutCommand.swift new file mode 100644 index 00000000..1b7e4c07 --- /dev/null +++ b/ShortcutCommand/ShortcutCommand.swift @@ -0,0 +1,125 @@ +// +// ShortcutCommand.swift +// ShortcutCommand +// +// Created by Sbarex on 25/12/24. +// Copyright © 2024 sbarex. All rights reserved. +// + +import AppIntents +import AppKit +import OSLog +import UniformTypeIdentifiers + +enum ShortcutCommandError: Error { + case invalidConfiguration +} + +enum OptionalEngineEnum: String, AppEnum { + static var typeDisplayRepresentation: TypeDisplayRepresentation = TypeDisplayRepresentation(name: "Option engine") + + case predefined + case html + case rtf + + static let caseDisplayRepresentations: [Self: DisplayRepresentation] = [ + .predefined: "predefined", + .html: "HTML", + .rtf: "RTF", + ] +} + +struct ShortcutCommand: AppIntent { + static var title: LocalizedStringResource { "Syntax Highlight source file" } + static var description: LocalizedStringResource { "Syntax Highlights the source code of a file." } + static var openAppWhenRun: Bool = false + + static var parameterSummary: some ParameterSummary { + Summary("Highlight source code of \(\.$inputFile) to a \(\.$engine) file.") { + \.$debugLog + } + } + + // Define the input parameter + @Parameter(title: "Input File", + description: "The source file to hightlights.", + supportedContentTypes: [UTType.sourceCode, UTType.text, UTType.data, UTType.item]) + var inputFile: IntentFile + @Parameter(title: "Engine", + description: "The rendering engine.", default: .predefined) + var engine: OptionalEngineEnum + + @Parameter(title: "Generate debug log", + description: "Save log to ~/Desktop/colorize.log", default: false) + var debugLog: Bool + + func perform() async throws -> some ReturnsValue { + let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "shortcut extension") + + os_log( + "Generating preview for file %{public}s…", + log: log, + type: .info, + inputFile.fileURL?.absoluteString ?? "?" + ) + + let _ = inputFile.data + + let settings = Settings(defaultsDomain: SCSHBaseXPCService.XPCDomain) + if self.engine != .predefined { + settings.format = self.engine == .html ? .html : .rtf + } + if let dir = SCSHBaseXPCService.getCustomStylesUrl(createIfMissing: false) { + settings.populateCSS(cssFolder: dir) + } + + let logFile = debugLog ? SCSHBaseXPCService.initLog(forSettings: settings) : URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent("colorize.log") + if !debugLog { + // Reset the log file. + try? "".write(to: logFile, atomically: true, encoding: .utf8) + } + defer { + if !debugLog { + try? FileManager.default.removeItem(at: logFile) + } + } + + os_log( + "Storing log on file %{public}s…", + log: log, + type: .debug, + logFile.path(percentEncoded: false) + ) + + let appBundleUrl = Bundle.main.bundleURL.appendingPathComponent("Contents/Resources") + + // TODO: Sandbox prevent to access the bundle of the main app, so is required to have a second copy of all highlight resources inside this extension bundle. + guard + let highlightBin = Bundle.main.url(forResource: "highlight", withExtension: "", subdirectory: "highlight/bin"), + let highlightDataDir = Bundle.main.url(forResource: "share", withExtension: "", subdirectory: "highlight"), + let dos2unix = Bundle.main.url(forResource: "dos2unix", withExtension: "")?.path, + let languages = Bundle.main.url(forResource: "languages", withExtension: "json"), + let extraCSS = Bundle.main.url(forResource: "style", withExtension: "css", subdirectory: "highlight") + else { + throw ShortcutCommandError.invalidConfiguration + } + + let highlightLanguages: [String: [String]] = (try? SCSHBaseXPCService.parseHighlightLanguages(file: languages)) ?? [:] + + do { + let r: (data: Data, settings: SettingsRendering) = try SCSHBaseXPCService.colorize(url: inputFile.fileURL!, settings: settings, highlightBin: highlightBin.path, dataDir: highlightDataDir.path, rsrcEsc: appBundleUrl.path, dos2unixBin: dos2unix, highlightLanguages: highlightLanguages, extraCss: extraCSS, overridingSettings: [:], logFile: logFile, logOs: log) + let dst = inputFile.fileURL!.deletingPathExtension().lastPathComponent + (settings.format == .html ? ".html" : ".rtf") + return .result(value: IntentFile(data: r.data, filename: dst, type: settings.format == .html ? UTType.html : UTType.rtf)) + } catch { + os_log( + "Error processing %{public}s: %{public}s!", + log: log, + type: .error, + inputFile.fileURL!.path, + error.localizedDescription + ) + throw error + } + } +} + diff --git a/ShortcutCommand/ShortcutCommandExtension.swift b/ShortcutCommand/ShortcutCommandExtension.swift new file mode 100644 index 00000000..58ee513e --- /dev/null +++ b/ShortcutCommand/ShortcutCommandExtension.swift @@ -0,0 +1,13 @@ +// +// ShortcutCommandExtension.swift +// ShortcutCommand +// +// Created by Sbarex on 25/12/24. +// Copyright © 2024 sbarex. All rights reserved. +// + +import AppIntents + +@main +struct ShortcutCommandExtension: AppIntentsExtension { +} diff --git a/SourceCodeSyntaxHighlight.xcodeproj/project.pbxproj b/SourceCodeSyntaxHighlight.xcodeproj/project.pbxproj index 35022af3..24dc8810 100644 --- a/SourceCodeSyntaxHighlight.xcodeproj/project.pbxproj +++ b/SourceCodeSyntaxHighlight.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 70; objects = { /* Begin PBXBuildFile section */ @@ -14,11 +14,11 @@ 8304B0B8238FA897007A455C /* TaskResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8304B0B6238FA897007A455C /* TaskResult.swift */; }; 8304B0B9238FA920007A455C /* SCSHError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8359239C23570C52001506B6 /* SCSHError.swift */; }; 8304B0BD238FBCC4007A455C /* SCSHBaseXPCService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8304B0BB238FBCC4007A455C /* SCSHBaseXPCService.swift */; }; - 830A2DAF2626C50B00C89F29 /* html_editor.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830A2DA82626C39A00C89F29 /* html_editor.lua */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 830A2DAF2626C50B00C89F29 /* html_editor.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830A2DA82626C39A00C89F29 /* html_editor.lua */; }; 830D15542378182800D5535C /* SCSHTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835923EB235A3A85001506B6 /* SCSHTheme.swift */; }; 830D15552378419F00D5535C /* NSColor+ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835923E9235A022C001506B6 /* NSColor+ext.swift */; }; 830D1559237961C900D5535C /* WarningUTIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830D1558237961C900D5535C /* WarningUTIViewController.swift */; }; - 830E831B273E9EC800B15859 /* debug.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830E8318273E9E6C00B15859 /* debug.lua */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 830E831B273E9EC800B15859 /* debug.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830E8318273E9E6C00B15859 /* debug.lua */; }; 8311D9C7235DE6D7006DC138 /* Data+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8311D9C6235DE6D7006DC138 /* Data+Ext.swift */; }; 8311D9C8235DE6D7006DC138 /* Data+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8311D9C6235DE6D7006DC138 /* Data+Ext.swift */; }; 8319450926383626002E5B86 /* dos2unix in Resources */ = {isa = PBXBuildFile; fileRef = 8319450826383626002E5B86 /* dos2unix */; }; @@ -38,6 +38,8 @@ 831FD81E2691FF6400C314CE /* UTI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D5F5A237F1E87007340E7 /* UTI.swift */; }; 831FD8202691FF6500C314CE /* UTI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D5F5A237F1E87007340E7 /* UTI.swift */; }; 831FD821269203EF00C314CE /* UTI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D5F5A237F1E87007340E7 /* UTI.swift */; }; + 832700BE2C0EEFAF00DD3E9D /* about.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 832700BB2C0EE86700DD3E9D /* about.lua */; }; + 832F7E5E2E054B9F0015DBBC /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 832F7E5D2E054B9F0015DBBC /* Yams */; }; 83408DDE23804A0700128B0C /* examples in Resources */ = {isa = PBXBuildFile; fileRef = 83408DDD23804A0600128B0C /* examples */; }; 83408DE02380505000128B0C /* CSSControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83408DDF2380505000128B0C /* CSSControlView.swift */; }; 8342C90E277EF4340018FCD8 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 8342C90D277EF4340018FCD8 /* Sparkle */; }; @@ -100,8 +102,9 @@ 836257A325A8BD8E00475069 /* HighlightWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8362579725A8BD6A00475069 /* HighlightWrapper.swift */; }; 836257BB25A9D7CB00475069 /* colorize.sh in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 8359236F2355B19F001506B6 /* colorize.sh */; }; 8362582925A9F3E100475069 /* Syntax Highlight XPC Render.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 838F465A238D813500268B4A /* Syntax Highlight XPC Render.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 83632E812F8E2BA5008B95DE /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 83632E802F8E2BA5008B95DE /* Yams */; }; 836A09E0270442F30067AF0D /* languages.json in CopyFiles */ = {isa = PBXBuildFile; fileRef = 836A09DE270441680067AF0D /* languages.json */; }; - 836CBCD92712221600A228AE /* vcs.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 836DAC07270AD7A900053043 /* vcs.lua */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 836CBCD92712221600A228AE /* vcs.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 836DAC07270AD7A900053043 /* vcs.lua */; }; 836CBCDC2712C70200A228AE /* VCSSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836CBCDB2712C70200A228AE /* VCSSettingsViewController.swift */; }; 836CD780283024BF00F074CB /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 836CD77F283024BF00F074CB /* Yams */; }; 836CD783283024D000F074CB /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 836CD782283024D000F074CB /* Yams */; }; @@ -157,13 +160,44 @@ 83A0691123672FD100C795D6 /* style.css in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 83A0691023672FD100C795D6 /* style.css */; }; 83A1C609245C441E0045C2AC /* ThemeCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83A1C608245C441E0045C2AC /* ThemeCollectionViewItem.swift */; }; 83A1C60A245C45980045C2AC /* ThemeCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8390B19023815FF200EA028A /* ThemeCollectionViewItem.xib */; }; + 83A25C432D1DA9DD00C8B349 /* languages.json in Resources */ = {isa = PBXBuildFile; fileRef = 836A09DE270441680067AF0D /* languages.json */; }; + 83A25C452D1DAA2200C8B349 /* share in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 831C70DA2618ABAB0011C3F8 /* share */; }; + 83A25C462D1DAA3800C8B349 /* colorize.sh in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 8359236F2355B19F001506B6 /* colorize.sh */; }; + 83A25C472D1DAA3D00C8B349 /* style.css in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 83A0691023672FD100C795D6 /* style.css */; }; + 83A25C482D1DAA3D00C8B349 /* style2.css in Copy Highlight share files */ = {isa = PBXBuildFile; fileRef = 834DA8332735BC0B00519C78 /* style2.css */; }; + 83A25C492D1DD79B00C8B349 /* libwrapper_highlight.dylib in Copy Highlight executable */ = {isa = PBXBuildFile; fileRef = 83B47BC825A77C6F00DE0CF4 /* libwrapper_highlight.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 83A25C4A2D1DD79B00C8B349 /* libhighlight.dylib in Copy Highlight executable */ = {isa = PBXBuildFile; fileRef = 8383705825AB7F700048A737 /* libhighlight.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 83A25C522D1DD91700C8B349 /* highlight in Copy Highlight executable */ = {isa = PBXBuildFile; fileRef = 83A25C512D1DD91700C8B349 /* highlight */; }; + 83A25C552D1DD9EC00C8B349 /* html_editor.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830A2DA82626C39A00C89F29 /* html_editor.lua */; }; + 83A25C562D1DD9F500C8B349 /* vcs.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 836DAC07270AD7A900053043 /* vcs.lua */; }; + 83A25C572D1DD9FC00C8B349 /* about.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 832700BB2C0EE86700DD3E9D /* about.lua */; }; + 83A25C582D1DDA0000C8B349 /* debug.lua in Copy extra plugins */ = {isa = PBXBuildFile; fileRef = 830E8318273E9E6C00B15859 /* debug.lua */; }; + 83A25C5A2D1DDA6500C8B349 /* dos2unix in Resources */ = {isa = PBXBuildFile; fileRef = 8319450826383626002E5B86 /* dos2unix */; }; + 83A25C5B2D1DDA7700C8B349 /* settings.yaml in Resources */ = {isa = PBXBuildFile; fileRef = 836CD788283029B600F074CB /* settings.yaml */; }; + 83A25C6A2D1E055600C8B349 /* touch_files.sh in Resources */ = {isa = PBXBuildFile; fileRef = 83A25C692D1E055000C8B349 /* touch_files.sh */; }; + 83A25C6B2D1E055600C8B349 /* touch_files.sh in Resources */ = {isa = PBXBuildFile; fileRef = 83A25C692D1E055000C8B349 /* touch_files.sh */; }; + 83ABC9C42D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex in Embed ExtensionKit Extensions */ = {isa = PBXBuildFile; fileRef = 83ABC9BA2D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 83ABC9CC2D1BF64700CF8972 /* Yams in Frameworks */ = {isa = PBXBuildFile; productRef = 83ABC9CB2D1BF64700CF8972 /* Yams */; }; + 83ABC9CD2D1BFE4500CF8972 /* SCSHBaseXPCService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8304B0BB238FBCC4007A455C /* SCSHBaseXPCService.swift */; }; + 83ABC9CE2D1BFE7800CF8972 /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836FE00125F22A360053B6E2 /* Settings.swift */; }; + 83ABC9CF2D1BFE9200CF8972 /* Settings+Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831C6C9C2616476B0011C3F8 /* Settings+Service.swift */; }; + 83ABC9D02D1BFF9D00CF8972 /* PlainSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834DA83B2736B84200519C78 /* PlainSettings.swift */; }; + 83ABC9D12D1BFFA900CF8972 /* NotificationCenter+ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83950DB125FD79CF002CF526 /* NotificationCenter+ext.swift */; }; + 83ABC9D22D1BFFB300CF8972 /* UTI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831D5F5A237F1E87007340E7 /* UTI.swift */; }; + 83ABC9D32D1BFFB900CF8972 /* ColorizeArgument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 834DA8412737C55B00519C78 /* ColorizeArgument.swift */; }; + 83ABC9D42D1BFFC100CF8972 /* File+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836D01E32386C7CD00B85545 /* File+Ext.swift */; }; + 83ABC9D52D1BFFCC00CF8972 /* TaskResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8304B0B6238FA897007A455C /* TaskResult.swift */; }; + 83ABC9D62D1BFFD600CF8972 /* SCSHError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8359239C23570C52001506B6 /* SCSHError.swift */; }; + 83ABC9D72D1BFFDE00CF8972 /* String+GShell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 839098C32379E34A005D3E7C /* String+GShell.swift */; }; + 83ABC9D82D1BFFE700CF8972 /* MagicAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8373D5CF2716B0A100B43140 /* MagicAttributes.swift */; }; + 83ABC9D92D1C001000CF8972 /* String+ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836D01E52386DE4E00B85545 /* String+ext.swift */; }; + 83ABC9DA2D1C002500CF8972 /* NSColor+ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835923E9235A022C001506B6 /* NSColor+ext.swift */; }; 83B4642A25A7198B00DE0CF4 /* UTIInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83B4642925A7198B00DE0CF4 /* UTIInfoViewController.swift */; }; 83B4644425A76D9700DE0CF4 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83B4644325A76D9700DE0CF4 /* AboutViewController.swift */; }; 83BA16E825EBC5AB0054A404 /* SliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83BA16E725EBC5AB0054A404 /* SliderView.swift */; }; 83E5E67C25AE1FF900FAF5E2 /* SaveAsFormatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83E5E67925AE1FF900FAF5E2 /* SaveAsFormatView.swift */; }; 83E5E68225AE242F00FAF5E2 /* SaveAsFormatView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83E5E67B25AE1FF900FAF5E2 /* SaveAsFormatView.xib */; }; 83EDC92D25F6E23100B1621E /* FontSelectorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83EDC92C25F6E23100B1621E /* FontSelectorViewController.swift */; }; - 83FD6ED3246B061600F5BDF3 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FD6ED2246B061600F5BDF3 /* main.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -188,6 +222,13 @@ remoteGlobalIDString = 83257FD82638126E00A8888F; remoteInfo = dos2unix; }; + 832F7E5F2E05510C0015DBBC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8359233D235599F6001506B6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 832F7E552E054B8E0015DBBC; + remoteInfo = settings_chk; + }; 8359236823559A2B001506B6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8359233D235599F6001506B6 /* Project object */; @@ -223,9 +264,53 @@ remoteGlobalIDString = 838F4659238D813500268B4A; remoteInfo = SyntaxHighlightRenderXPC; }; + 83A25C702D1E08B000C8B349 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8359233D235599F6001506B6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 83A25C6C2D1E06CC00C8B349; + remoteInfo = extra_resources; + }; + 83A25C742D1E08D000C8B349 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8359233D235599F6001506B6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 83A25C6C2D1E06CC00C8B349; + remoteInfo = extra_resources; + }; + 83A25C762D1E08DF00C8B349 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83B47BB725A77AEE00DE0CF4 /* highlight-wrapper.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 83B4645425A779FC00DE0CF4; + remoteInfo = "highlight-wrapper"; + }; + 83A25C782D1E08E900C8B349 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 832580AF263812C800A8888F /* dos2unix.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 83257FD82638126E00A8888F; + remoteInfo = dos2unix; + }; + 83ABC9C22D1BF61900CF8972 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8359233D235599F6001506B6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 83ABC9B92D1BF61900CF8972; + remoteInfo = ShortcutCommand; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 832F7E542E054B8E0015DBBC /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; 8359236E23559A2B001506B6 /* Embed Foundation Extensions */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -332,11 +417,64 @@ files = ( 830A2DAF2626C50B00C89F29 /* html_editor.lua in Copy extra plugins */, 836CBCD92712221600A228AE /* vcs.lua in Copy extra plugins */, + 832700BE2C0EEFAF00DD3E9D /* about.lua in Copy extra plugins */, 830E831B273E9EC800B15859 /* debug.lua in Copy extra plugins */, ); name = "Copy extra plugins"; runOnlyForDeploymentPostprocessing = 0; }; + 83A25C532D1DD9AD00C8B349 /* Copy Highlight executable */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = highlight/bin; + dstSubfolderSpec = 7; + files = ( + 83A25C522D1DD91700C8B349 /* highlight in Copy Highlight executable */, + 83A25C4A2D1DD79B00C8B349 /* libhighlight.dylib in Copy Highlight executable */, + 83A25C492D1DD79B00C8B349 /* libwrapper_highlight.dylib in Copy Highlight executable */, + ); + name = "Copy Highlight executable"; + runOnlyForDeploymentPostprocessing = 0; + }; + 83A25C542D1DD9D300C8B349 /* Copy extra plugins */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = highlight/share/plugins; + dstSubfolderSpec = 7; + files = ( + 83A25C582D1DDA0000C8B349 /* debug.lua in Copy extra plugins */, + 83A25C572D1DD9FC00C8B349 /* about.lua in Copy extra plugins */, + 83A25C562D1DD9F500C8B349 /* vcs.lua in Copy extra plugins */, + 83A25C552D1DD9EC00C8B349 /* html_editor.lua in Copy extra plugins */, + ); + name = "Copy extra plugins"; + runOnlyForDeploymentPostprocessing = 0; + }; + 83A25C592D1DDA1B00C8B349 /* Copy Highlight share files */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = highlight; + dstSubfolderSpec = 7; + files = ( + 83A25C462D1DAA3800C8B349 /* colorize.sh in Copy Highlight share files */, + 83A25C452D1DAA2200C8B349 /* share in Copy Highlight share files */, + 83A25C472D1DAA3D00C8B349 /* style.css in Copy Highlight share files */, + 83A25C482D1DAA3D00C8B349 /* style2.css in Copy Highlight share files */, + ); + name = "Copy Highlight share files"; + runOnlyForDeploymentPostprocessing = 0; + }; + 83ABC9C52D1BF61900CF8972 /* Embed ExtensionKit Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(EXTENSIONS_FOLDER_PATH)"; + dstSubfolderSpec = 16; + files = ( + 83ABC9C42D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex in Embed ExtensionKit Extensions */, + ); + name = "Embed ExtensionKit Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; 83B4856E25A7A1BF00DE0CF4 /* Copy Highlight share files */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 12; @@ -351,18 +489,10 @@ name = "Copy Highlight share files"; runOnlyForDeploymentPostprocessing = 0; }; - 83FD6ECE246B061600F5BDF3 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 8304A20B2F61616200FFFB35 /* syntax-highlight.rb */ = {isa = PBXFileReference; lastKnownFileType = text.script.ruby; path = "syntax-highlight.rb"; sourceTree = ""; }; 8304B0B4238E8B21007A455C /* about_highlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = about_highlight.png; sourceTree = ""; }; 8304B0B6238FA897007A455C /* TaskResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskResult.swift; sourceTree = ""; }; 8304B0BB238FBCC4007A455C /* SCSHBaseXPCService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SCSHBaseXPCService.swift; sourceTree = ""; }; @@ -542,6 +672,8 @@ 832580C0263812C800A8888F /* djgpp.mak */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = djgpp.mak; sourceTree = ""; }; 832580C1263812C800A8888F /* DEVEL.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = DEVEL.txt; sourceTree = ""; }; 832580C2263812C800A8888F /* unix2dos.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = unix2dos.c; sourceTree = ""; }; + 832700BB2C0EE86700DD3E9D /* about.lua */ = {isa = PBXFileReference; lastKnownFileType = text; path = about.lua; sourceTree = ""; }; + 832F7E562E054B8E0015DBBC /* settings_chk */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = settings_chk; sourceTree = BUILT_PRODUCTS_DIR; }; 833C295C236028B000B14757 /* LICENSE.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE.txt; sourceTree = ""; }; 83408DDD23804A0600128B0C /* examples */ = {isa = PBXFileReference; lastKnownFileType = folder; path = examples; sourceTree = ""; }; 83408DDF2380505000128B0C /* CSSControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CSSControlView.swift; sourceTree = ""; }; @@ -629,10 +761,16 @@ 83950DB125FD79CF002CF526 /* NotificationCenter+ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationCenter+ext.swift"; sourceTree = ""; }; 83A0691023672FD100C795D6 /* style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = style.css; sourceTree = ""; }; 83A1C608245C441E0045C2AC /* ThemeCollectionViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeCollectionViewItem.swift; sourceTree = ""; }; + 83A25C4B2D1DD7DB00C8B349 /* highlight */ = {isa = PBXFileReference; lastKnownFileType = text; name = highlight; path = "../../../../../../../../Develop/macos/QLExt/highlight-wrapper/highlight/build-Debug/bin/highlight"; sourceTree = BUILT_PRODUCTS_DIR; }; + 83A25C512D1DD91700C8B349 /* highlight */ = {isa = PBXFileReference; lastKnownFileType = text; name = highlight; path = highlight/highlight; sourceTree = BUILT_PRODUCTS_DIR; }; + 83A25C622D1E014B00C8B349 /* support_files.xcfilelist */ = {isa = PBXFileReference; lastKnownFileType = text.xcfilelist; path = support_files.xcfilelist; sourceTree = ""; }; + 83A25C692D1E055000C8B349 /* touch_files.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = touch_files.sh; sourceTree = ""; }; + 83ABC9BA2D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.extensionkit-extension"; includeInIndex = 0; path = "Syntax Hightlight Shortcut Action.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + 83B3CBA12F8E65640021057D /* entitlements.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = entitlements.entitlements; sourceTree = ""; }; + 83B3CBA22F8E67480021057D /* entitlements.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = entitlements.entitlements; sourceTree = ""; }; 83B4642925A7198B00DE0CF4 /* UTIInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UTIInfoViewController.swift; sourceTree = ""; }; 83B4644325A76D9700DE0CF4 /* AboutViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; 83B4646825A779FD00DE0CF4 /* highlight-wrapper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = "highlight-wrapper.xcodeproj"; sourceTree = ""; }; - 83B47B9C25A77A5600DE0CF4 /* wrapper_highlight.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wrapper_highlight.h; sourceTree = ""; }; 83B47BB725A77AEE00DE0CF4 /* highlight-wrapper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "highlight-wrapper.xcodeproj"; path = "highlight-wrapper/highlight-wrapper.xcodeproj"; sourceTree = ""; }; 83B47BC225A77C1000DE0CF4 /* SourceCodeSyntaxHighlight-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SourceCodeSyntaxHighlight-Bridging-Header.h"; sourceTree = ""; }; 83B47BC825A77C6F00DE0CF4 /* libwrapper_highlight.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libwrapper_highlight.dylib; path = highlight/libwrapper_highlight.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -644,12 +782,34 @@ 83E5E67B25AE1FF900FAF5E2 /* SaveAsFormatView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SaveAsFormatView.xib; sourceTree = ""; }; 83EAEE842740FD2F0093B9B7 /* vcs_preview.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = vcs_preview.png; sourceTree = ""; }; 83EDC92C25F6E23100B1621E /* FontSelectorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontSelectorViewController.swift; sourceTree = ""; }; - 83FD6ED0246B061600F5BDF3 /* relaunch */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = relaunch; sourceTree = BUILT_PRODUCTS_DIR; }; - 83FD6ED2246B061600F5BDF3 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; + 83F70DCF305ACC8900D4853F /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; 83FD6EED246C71C600F5BDF3 /* Syntax Highlight XPC Render.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Syntax Highlight XPC Render.entitlements"; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + 83ABC9C82D1BF61900CF8972 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = 83ABC9B92D1BF61900CF8972 /* Syntax Hightlight Shortcut Action */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 832F7E572E054B8E0015DBBC /* settings_chk */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = settings_chk; sourceTree = ""; }; + 83ABC9BB2D1BF61900CF8972 /* ShortcutCommand */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (83ABC9C82D1BF61900CF8972 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = ShortcutCommand; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ + 832F7E532E054B8E0015DBBC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 832F7E5E2E054B9F0015DBBC /* Yams in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 83592342235599F6001506B6 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -667,6 +827,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 83632E812F8E2BA5008B95DE /* Yams in Frameworks */, 8359235F23559A2B001506B6 /* Quartz.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -695,10 +856,11 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 83FD6ECD246B061600F5BDF3 /* Frameworks */ = { + 83ABC9B72D1BF61900CF8972 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 83ABC9CC2D1BF64700CF8972 /* Yams in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -712,6 +874,14 @@ name = Products; sourceTree = ""; }; + 8304A20C2F61616200FFFB35 /* Casks */ = { + isa = PBXGroup; + children = ( + 8304A20B2F61616200FFFB35 /* syntax-highlight.rb */, + ); + path = Casks; + sourceTree = ""; + }; 83194503263812E2002E5B86 /* Products */ = { isa = PBXGroup; children = ( @@ -722,8 +892,10 @@ 831C6CF92618AAA50011C3F8 /* resources */ = { isa = PBXGroup; children = ( + 83A25C692D1E055000C8B349 /* touch_files.sh */, 830A2DA82626C39A00C89F29 /* html_editor.lua */, 836DAC07270AD7A900053043 /* vcs.lua */, + 832700BB2C0EE86700DD3E9D /* about.lua */, 830E8318273E9E6C00B15859 /* debug.lua */, 8319450826383626002E5B86 /* dos2unix */, 831C6CFA2618AAB50011C3F8 /* highlight */, @@ -1040,6 +1212,7 @@ 832580C3263812C800A8888F /* dos2unix */ = { isa = PBXGroup; children = ( + 83B3CBA22F8E67480021057D /* entitlements.entitlements */, 83D33410263A96C3003CEEFD /* .gitignore */, 83258038263812C800A8888F /* man */, 83258039263812C800A8888F /* COPYING.txt */, @@ -1081,6 +1254,8 @@ 8359233C235599F6001506B6 = { isa = PBXGroup; children = ( + 8304A20C2F61616200FFFB35 /* Casks */, + 83A25C622D1E014B00C8B349 /* support_files.xcfilelist */, 8311D9A3235CDAA1006DC138 /* README.md */, 836D01DF2385214D00B85545 /* CHANGELOG.md */, 8383704C25AB733E0048A737 /* TODO.md */, @@ -1093,8 +1268,9 @@ 8359236023559A2B001506B6 /* QLExtension */, 8359237C23563BDF001506B6 /* XPCService */, 838F465B238D813500268B4A /* SyntaxHighlightRenderXPC */, - 83FD6ED1246B061600F5BDF3 /* relaunch */, 8373D5C42716161800B43140 /* syntax_highlight_cli */, + 83ABC9BB2D1BF61900CF8972 /* ShortcutCommand */, + 832F7E572E054B8E0015DBBC /* settings_chk */, 8359235D23559A2B001506B6 /* Frameworks */, 83592346235599F6001506B6 /* Products */, 83B47BB725A77AEE00DE0CF4 /* highlight-wrapper.xcodeproj */, @@ -1108,8 +1284,11 @@ 8359235C23559A2B001506B6 /* Syntax Highlight Quick Look Extension.appex */, 8359237B23563BDF001506B6 /* Syntax Highlight XPC Service.xpc */, 838F465A238D813500268B4A /* Syntax Highlight XPC Render.xpc */, - 83FD6ED0246B061600F5BDF3 /* relaunch */, + 83A25C512D1DD91700C8B349 /* highlight */, 8373D5C32716161800B43140 /* syntax_highlight_cli */, + 83A25C4B2D1DD7DB00C8B349 /* highlight */, + 83ABC9BA2D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex */, + 832F7E562E054B8E0015DBBC /* settings_chk */, ); name = Products; sourceTree = ""; @@ -1148,6 +1327,7 @@ 8359235D23559A2B001506B6 /* Frameworks */ = { isa = PBXGroup; children = ( + 83F70DCF305ACC8900D4853F /* CoreServices.framework */, 83B47BC825A77C6F00DE0CF4 /* libwrapper_highlight.dylib */, 8383705825AB7F700048A737 /* libhighlight.dylib */, 8359239A23565890001506B6 /* Foundation.framework */, @@ -1273,9 +1453,9 @@ 83B4646725A779FD00DE0CF4 /* highlight-wrapper */ = { isa = PBXGroup; children = ( + 83B3CBA12F8E65640021057D /* entitlements.entitlements */, 8361B16E263A962300B85467 /* .gitignore */, 83B4646825A779FD00DE0CF4 /* highlight-wrapper.xcodeproj */, - 83B47B9C25A77A5600DE0CF4 /* wrapper_highlight.h */, ); path = "highlight-wrapper"; sourceTree = ""; @@ -1304,17 +1484,68 @@ name = Themes; sourceTree = ""; }; - 83FD6ED1246B061600F5BDF3 /* relaunch */ = { - isa = PBXGroup; - children = ( - 83FD6ED2246B061600F5BDF3 /* main.swift */, +/* End PBXGroup section */ + +/* Begin PBXLegacyTarget section */ + 83A25C6C2D1E06CC00C8B349 /* extra_resources */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "touch_files.sh $(SRCROOT)/support_files.xcfilelist"; + buildConfigurationList = 83A25C6D2D1E06CC00C8B349 /* Build configuration list for PBXLegacyTarget "extra_resources" */; + buildPhases = ( ); - path = relaunch; - sourceTree = ""; + buildToolPath = /bin/sh; + buildWorkingDirectory = "$(SRCROOT)/Application/resources/"; + dependencies = ( + ); + name = extra_resources; + packageProductDependencies = ( + ); + passBuildSettingsInEnvironment = 1; + productName = extra_resources; }; -/* End PBXGroup section */ + 83FDB5322D10493D00D55608 /* yaml checker */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "${SRCROOT}/settings_chk/check.sh"; + buildConfigurationList = 83FDB5332D10493D00D55608 /* Build configuration list for PBXLegacyTarget "yaml checker" */; + buildPhases = ( + ); + buildToolPath = /bin/sh; + buildWorkingDirectory = ""; + dependencies = ( + 832F7E602E05510C0015DBBC /* PBXTargetDependency */, + ); + name = "yaml checker"; + packageProductDependencies = ( + ); + passBuildSettingsInEnvironment = 1; + productName = "yaml checker"; + }; +/* End PBXLegacyTarget section */ /* Begin PBXNativeTarget section */ + 832F7E552E054B8E0015DBBC /* settings_chk */ = { + isa = PBXNativeTarget; + buildConfigurationList = 832F7E5A2E054B8E0015DBBC /* Build configuration list for PBXNativeTarget "settings_chk" */; + buildPhases = ( + 832F7E522E054B8E0015DBBC /* Sources */, + 832F7E532E054B8E0015DBBC /* Frameworks */, + 832F7E542E054B8E0015DBBC /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 832F7E572E054B8E0015DBBC /* settings_chk */, + ); + name = settings_chk; + packageProductDependencies = ( + 832F7E5D2E054B9F0015DBBC /* Yams */, + ); + productName = settings_chk; + productReference = 832F7E562E054B8E0015DBBC /* settings_chk */; + productType = "com.apple.product-type.tool"; + }; 83592344235599F6001506B6 /* Syntax Highlight */ = { isa = PBXNativeTarget; buildConfigurationList = 83592355235599F9001506B6 /* Build configuration list for PBXNativeTarget "Syntax Highlight" */; @@ -1330,16 +1561,19 @@ 8396DF3A257C4203005D6489 /* Embed Frameworks */, 836257C625A9DA1A00475069 /* Copy Highlight executable */, 839BAB942601480A00D399ED /* Copy extra plugins */, + 83ABC9C52D1BF61900CF8972 /* Embed ExtensionKit Extensions */, ); buildRules = ( ); dependencies = ( + 83A25C752D1E08D000C8B349 /* PBXTargetDependency */, 836B55CE272E92D9008297D5 /* PBXTargetDependency */, 1F39AA712741F97600569E96 /* PBXTargetDependency */, 8319450F26394445002E5B86 /* PBXTargetDependency */, 8359236923559A2B001506B6 /* PBXTargetDependency */, 8359238523563BDF001506B6 /* PBXTargetDependency */, 838F4664238D813500268B4A /* PBXTargetDependency */, + 83ABC9C32D1BF61900CF8972 /* PBXTargetDependency */, ); name = "Syntax Highlight"; packageProductDependencies = ( @@ -1429,22 +1663,34 @@ productReference = 838F465A238D813500268B4A /* Syntax Highlight XPC Render.xpc */; productType = "com.apple.product-type.xpc-service"; }; - 83FD6ECF246B061600F5BDF3 /* relaunch */ = { + 83ABC9B92D1BF61900CF8972 /* Syntax Hightlight Shortcut Action */ = { isa = PBXNativeTarget; - buildConfigurationList = 83FD6EDA246B061600F5BDF3 /* Build configuration list for PBXNativeTarget "relaunch" */; + buildConfigurationList = 83ABC9C92D1BF61900CF8972 /* Build configuration list for PBXNativeTarget "Syntax Hightlight Shortcut Action" */; buildPhases = ( - 83FD6ECC246B061600F5BDF3 /* Sources */, - 83FD6ECD246B061600F5BDF3 /* Frameworks */, - 83FD6ECE246B061600F5BDF3 /* CopyFiles */, + 83ABC9B62D1BF61900CF8972 /* Sources */, + 83ABC9B72D1BF61900CF8972 /* Frameworks */, + 83ABC9B82D1BF61900CF8972 /* Resources */, + 83A25C592D1DDA1B00C8B349 /* Copy Highlight share files */, + 83A25C532D1DD9AD00C8B349 /* Copy Highlight executable */, + 83A25C542D1DD9D300C8B349 /* Copy extra plugins */, ); buildRules = ( ); dependencies = ( + 83A25C792D1E08E900C8B349 /* PBXTargetDependency */, + 83A25C772D1E08DF00C8B349 /* PBXTargetDependency */, + 83A25C712D1E08B000C8B349 /* PBXTargetDependency */, ); - name = relaunch; - productName = relaunch; - productReference = 83FD6ED0246B061600F5BDF3 /* relaunch */; - productType = "com.apple.product-type.tool"; + fileSystemSynchronizedGroups = ( + 83ABC9BB2D1BF61900CF8972 /* ShortcutCommand */, + ); + name = "Syntax Hightlight Shortcut Action"; + packageProductDependencies = ( + 83ABC9CB2D1BF64700CF8972 /* Yams */, + ); + productName = ShortcutCommand; + productReference = 83ABC9BA2D1BF61900CF8972 /* Syntax Hightlight Shortcut Action.appex */; + productType = "com.apple.product-type.extensionkit-extension"; }; /* End PBXNativeTarget section */ @@ -1453,10 +1699,13 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastSwiftUpdateCheck = 1300; - LastUpgradeCheck = 1520; + LastSwiftUpdateCheck = 1640; + LastUpgradeCheck = 2700; ORGANIZATIONNAME = sbarex; TargetAttributes = { + 832F7E552E054B8E0015DBBC = { + CreatedOnToolsVersion = 16.4; + }; 83592344235599F6001506B6 = { CreatedOnToolsVersion = 11.0; }; @@ -1473,8 +1722,14 @@ CreatedOnToolsVersion = 11.2.1; LastSwiftMigration = 1300; }; - 83FD6ECF246B061600F5BDF3 = { - CreatedOnToolsVersion = 11.4.1; + 83A25C6C2D1E06CC00C8B349 = { + CreatedOnToolsVersion = 16.2; + }; + 83ABC9B92D1BF61900CF8972 = { + CreatedOnToolsVersion = 16.2; + }; + 83FDB5322D10493D00D55608 = { + CreatedOnToolsVersion = 16.2; }; }; }; @@ -1485,6 +1740,7 @@ knownRegions = ( en, Base, + it, ); mainGroup = 8359233C235599F6001506B6; packageReferences = ( @@ -1513,8 +1769,11 @@ 8359235B23559A2B001506B6 /* Syntax Highlight Quick Look Extension */, 8359237A23563BDF001506B6 /* Syntax Highlight XPC Service */, 838F4659238D813500268B4A /* Syntax Highlight XPC Render */, - 83FD6ECF246B061600F5BDF3 /* relaunch */, + 83ABC9B92D1BF61900CF8972 /* Syntax Hightlight Shortcut Action */, + 832F7E552E054B8E0015DBBC /* settings_chk */, 8373D5C22716161800B43140 /* syntax_highlight_cli */, + 83FDB5322D10493D00D55608 /* yaml checker */, + 83A25C6C2D1E06CC00C8B349 /* extra_resources */, ); }; /* End PBXProject section */ @@ -1536,6 +1795,7 @@ 836CD789283029C500F074CB /* settings.yaml in Resources */, 83408DDE23804A0700128B0C /* examples in Resources */, 837F088623802A8000D3893B /* SyntaxHighlight.help in Resources */, + 83A25C6A2D1E055600C8B349 /* touch_files.sh in Resources */, 83950D7D25FC9B01002CF526 /* ThemeEditorView.xib in Resources */, 8319450926383626002E5B86 /* dos2unix in Resources */, 8373D5DB2716B2BE00B43140 /* syntax_highlight_cli in Resources */, @@ -1550,6 +1810,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 83ABC9B82D1BF61900CF8972 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 83A25C5B2D1DDA7700C8B349 /* settings.yaml in Resources */, + 83A25C5A2D1DDA6500C8B349 /* dos2unix in Resources */, + 83A25C432D1DA9DD00C8B349 /* languages.json in Resources */, + 83A25C6B2D1E055600C8B349 /* touch_files.sh in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -1574,6 +1845,13 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 832F7E522E054B8E0015DBBC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 83592341235599F6001506B6 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1712,11 +1990,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 83FD6ECC246B061600F5BDF3 /* Sources */ = { + 83ABC9B62D1BF61900CF8972 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 83FD6ED3246B061600F5BDF3 /* main.swift in Sources */, + 83ABC9D32D1BFFB900CF8972 /* ColorizeArgument.swift in Sources */, + 83ABC9D62D1BFFD600CF8972 /* SCSHError.swift in Sources */, + 83ABC9D82D1BFFE700CF8972 /* MagicAttributes.swift in Sources */, + 83ABC9D52D1BFFCC00CF8972 /* TaskResult.swift in Sources */, + 83ABC9D12D1BFFA900CF8972 /* NotificationCenter+ext.swift in Sources */, + 83ABC9CF2D1BFE9200CF8972 /* Settings+Service.swift in Sources */, + 83ABC9DA2D1C002500CF8972 /* NSColor+ext.swift in Sources */, + 83ABC9D02D1BFF9D00CF8972 /* PlainSettings.swift in Sources */, + 83ABC9D72D1BFFDE00CF8972 /* String+GShell.swift in Sources */, + 83ABC9D92D1C001000CF8972 /* String+ext.swift in Sources */, + 83ABC9CE2D1BFE7800CF8972 /* Settings.swift in Sources */, + 83ABC9D42D1BFFC100CF8972 /* File+Ext.swift in Sources */, + 83ABC9D22D1BFFB300CF8972 /* UTI.swift in Sources */, + 83ABC9CD2D1BFE4500CF8972 /* SCSHBaseXPCService.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1738,6 +2029,11 @@ name = dos2unix; targetProxy = 8319450E26394445002E5B86 /* PBXContainerItemProxy */; }; + 832F7E602E05510C0015DBBC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 832F7E552E054B8E0015DBBC /* settings_chk */; + targetProxy = 832F7E5F2E05510C0015DBBC /* PBXContainerItemProxy */; + }; 8359236923559A2B001506B6 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8359235B23559A2B001506B6 /* Syntax Highlight Quick Look Extension */; @@ -1763,6 +2059,31 @@ target = 838F4659238D813500268B4A /* Syntax Highlight XPC Render */; targetProxy = 838F4663238D813500268B4A /* PBXContainerItemProxy */; }; + 83A25C712D1E08B000C8B349 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 83A25C6C2D1E06CC00C8B349 /* extra_resources */; + targetProxy = 83A25C702D1E08B000C8B349 /* PBXContainerItemProxy */; + }; + 83A25C752D1E08D000C8B349 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 83A25C6C2D1E06CC00C8B349 /* extra_resources */; + targetProxy = 83A25C742D1E08D000C8B349 /* PBXContainerItemProxy */; + }; + 83A25C772D1E08DF00C8B349 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "highlight-wrapper"; + targetProxy = 83A25C762D1E08DF00C8B349 /* PBXContainerItemProxy */; + }; + 83A25C792D1E08E900C8B349 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = dos2unix; + targetProxy = 83A25C782D1E08E900C8B349 /* PBXContainerItemProxy */; + }; + 83ABC9C32D1BF61900CF8972 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 83ABC9B92D1BF61900CF8972 /* Syntax Hightlight Shortcut Action */; + targetProxy = 83ABC9C22D1BF61900CF8972 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -1777,11 +2098,73 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 832F7E5B2E054B8E0015DBBC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + AUTOMATION_APPLE_EVENTS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = D5VMCLD3ZK; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO; + ENABLE_RESOURCE_ACCESS_CALENDARS = NO; + ENABLE_RESOURCE_ACCESS_CAMERA = NO; + ENABLE_RESOURCE_ACCESS_CONTACTS = NO; + ENABLE_RESOURCE_ACCESS_LOCATION = NO; + ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + INSTALL_PATH = ""; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 12.0; + PRODUCT_BUNDLE_IDENTIFIER = "org.sbarex.SourceCodeSyntaxHighlight.settings-check"; + PRODUCT_NAME = "$(TARGET_NAME)"; + RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO; + RUNTIME_EXCEPTION_ALLOW_JIT = NO; + RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO; + RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO; + RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO; + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 832F7E5C2E054B8E0015DBBC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + AUTOMATION_APPLE_EVENTS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = D5VMCLD3ZK; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO; + ENABLE_RESOURCE_ACCESS_CALENDARS = NO; + ENABLE_RESOURCE_ACCESS_CAMERA = NO; + ENABLE_RESOURCE_ACCESS_CONTACTS = NO; + ENABLE_RESOURCE_ACCESS_LOCATION = NO; + ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + INSTALL_PATH = ""; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 12.0; + PRODUCT_BUNDLE_IDENTIFIER = "org.sbarex.SourceCodeSyntaxHighlight.settings-check"; + PRODUCT_NAME = "$(TARGET_NAME)"; + RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO; + RUNTIME_EXCEPTION_ALLOW_JIT = NO; + RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO; + RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO; + RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO; + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = NO; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; 83592353235599F9001506B6 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -1837,7 +2220,9 @@ ONLY_ACTIVE_ARCH = YES; OTHER_SWIFT_FLAGS = ""; SDKROOT = macosx; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; }; @@ -1848,6 +2233,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -1895,7 +2281,9 @@ MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; }; @@ -1906,19 +2294,21 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Application/SCSHApp.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 81; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", ); + HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/highlight-wrapper\""; INFOPLIST_FILE = Application/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", @@ -1928,10 +2318,12 @@ "$(inherited)", "\"$(BUILT_PRODUCTS_DIR)/highlight\"", ); - MARKETING_VERSION = 2.1.21; + MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 2.1.32; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + REGISTER_APP_GROUPS = YES; SWIFT_OBJC_BRIDGING_HEADER = "Application/SourceCodeSyntaxHighlight-Bridging-Header.h"; SWIFT_VERSION = 5.0; }; @@ -1942,20 +2334,22 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Application/SCSHApp.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 81; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", ); + HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/highlight-wrapper\""; INFOPLIST_FILE = Application/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", @@ -1965,11 +2359,13 @@ "$(inherited)", "\"$(BUILT_PRODUCTS_DIR)/highlight\"", ); - MARKETING_VERSION = 2.1.21; + MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 2.1.32; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + REGISTER_APP_GROUPS = YES; SWIFT_OBJC_BRIDGING_HEADER = "Application/SourceCodeSyntaxHighlight-Bridging-Header.h"; SWIFT_VERSION = 5.0; }; @@ -1979,11 +2375,11 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_ENTITLEMENTS = QLExtension/QLExtension.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 69; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 81; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1995,10 +2391,12 @@ "@executable_path/../Frameworks", "@executable_path/../../../../Frameworks", ); - MARKETING_VERSION = 2.1.19; + MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 2.1.32; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.QuickLookExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + REGISTER_APP_GROUPS = YES; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; }; @@ -2008,12 +2406,12 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_ENTITLEMENTS = QLExtension/QLExtension.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 69; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 81; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -2025,11 +2423,13 @@ "@executable_path/../Frameworks", "@executable_path/../../../../Frameworks", ); - MARKETING_VERSION = 2.1.19; + MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 2.1.32; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.QuickLookExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + REGISTER_APP_GROUPS = YES; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; }; @@ -2039,12 +2439,12 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_ENTITLEMENTS = XPCService/XPCServiceRelease.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 81; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = XPCService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -2052,10 +2452,12 @@ "$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST)_$(_BOOL_$(SKIP_INSTALL)))", ); LIBRARY_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/highlight\""; - MARKETING_VERSION = 2.1.21; + MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 2.1.32; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.XPCService; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + REGISTER_APP_GROUPS = YES; SKIP_INSTALL = YES; SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_OBJC_INTERFACE_HEADER_NAME = ""; @@ -2067,13 +2469,13 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_ENTITLEMENTS = XPCService/XPCServiceRelease.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 81; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = XPCService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -2081,11 +2483,13 @@ "$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST)_$(_BOOL_$(SKIP_INSTALL)))", ); LIBRARY_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/highlight\""; - MARKETING_VERSION = 2.1.21; + MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 2.1.32; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.XPCService; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + REGISTER_APP_GROUPS = YES; SKIP_INSTALL = YES; SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_OBJC_INTERFACE_HEADER_NAME = ""; @@ -2096,15 +2500,32 @@ 8373D5C72716161800B43140 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + AUTOMATION_APPLE_EVENTS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_ENTITLEMENTS = syntax_highlight_cli/syntax_highlight_cli.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15.4; + ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO; + ENABLE_RESOURCE_ACCESS_CALENDARS = NO; + ENABLE_RESOURCE_ACCESS_CAMERA = NO; + ENABLE_RESOURCE_ACCESS_CONTACTS = NO; + ENABLE_RESOURCE_ACCESS_LOCATION = NO; + ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO; + INSTALL_PATH = "\"$(BUILT_PRODUCTS_DIR)/Syntax Highlight.app/Contents/Resources\""; + MACOSX_DEPLOYMENT_TARGET = 12.0; + PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.cli; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO; + RUNTIME_EXCEPTION_ALLOW_JIT = NO; + RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO; + RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO; + RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO; + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = YES; + SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; }; name = Debug; @@ -2112,15 +2533,32 @@ 8373D5C82716161800B43140 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + AUTOMATION_APPLE_EVENTS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_ENTITLEMENTS = syntax_highlight_cli/syntax_highlight_cli.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15.4; + ENABLE_RESOURCE_ACCESS_AUDIO_INPUT = NO; + ENABLE_RESOURCE_ACCESS_CALENDARS = NO; + ENABLE_RESOURCE_ACCESS_CAMERA = NO; + ENABLE_RESOURCE_ACCESS_CONTACTS = NO; + ENABLE_RESOURCE_ACCESS_LOCATION = NO; + ENABLE_RESOURCE_ACCESS_PHOTO_LIBRARY = NO; + INSTALL_PATH = "\"$(BUILT_PRODUCTS_DIR)/Syntax Highlight.app/Contents/Resources\""; + MACOSX_DEPLOYMENT_TARGET = 12.0; + PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.cli; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + RUNTIME_EXCEPTION_ALLOW_DYLD_ENVIRONMENT_VARIABLES = NO; + RUNTIME_EXCEPTION_ALLOW_JIT = NO; + RUNTIME_EXCEPTION_ALLOW_UNSIGNED_EXECUTABLE_MEMORY = NO; + RUNTIME_EXCEPTION_DEBUGGING_TOOL = NO; + RUNTIME_EXCEPTION_DISABLE_EXECUTABLE_PAGE_PROTECTION = NO; + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = YES; + SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; }; name = Release; @@ -2130,12 +2568,12 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = "SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements"; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 81; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -2146,10 +2584,12 @@ "$(inherited)", "@loader_path/../../../../Frameworks", ); - MARKETING_VERSION = 2.1.21; + MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 2.1.32; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.XPCRender; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + REGISTER_APP_GROUPS = YES; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "SyntaxHighlightRenderXPC/Syntax Highlight XPC Render-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -2162,13 +2602,13 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = "SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements"; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 81; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = D5VMCLD3ZK; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -2179,50 +2619,164 @@ "$(inherited)", "@loader_path/../../../../Frameworks", ); - MARKETING_VERSION = 2.1.21; + MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 2.1.32; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.XPCRender; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + REGISTER_APP_GROUPS = YES; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "SyntaxHighlightRenderXPC/Syntax Highlight XPC Render-Bridging-Header.h"; SWIFT_VERSION = 5.0; }; name = Release; }; - 83FD6ED4246B061600F5BDF3 /* Debug */ = { + 83A25C6E2D1E06CC00C8B349 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Manual; - DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; - MACOSX_DEPLOYMENT_TARGET = 10.15; - PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.relaunch; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + DEBUGGING_SYMBOLS = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 12.0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + }; + name = Debug; + }; + 83A25C6F2D1E06CC00C8B349 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu17; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 12.0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 83ABC9C62D1BF61900CF8972 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_ENTITLEMENTS = ShortcutCommand/ShortcutCommand.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 81; + DEVELOPMENT_TEAM = D5VMCLD3ZK; + ENABLE_HARDENED_RUNTIME = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ShortcutCommand/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = ShortcutCommand; + INFOPLIST_KEY_NSHumanReadableCopyright = "Developed by SBAREX (2019-2024)."; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@executable_path/../../../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 15.0; + MARKETING_VERSION = 2.1.32; + PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.ShortcutCommand; + PRODUCT_NAME = "$(TARGET_NAME)"; + REGISTER_APP_GROUPS = YES; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; }; name = Debug; }; - 83FD6ED5246B061600F5BDF3 /* Release */ = { + 83ABC9C72D1BF61900CF8972 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Manual; - DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = ""; - MACOSX_DEPLOYMENT_TARGET = 10.15; - PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.relaunch; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_ENTITLEMENTS = ShortcutCommand/ShortcutCommand.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 81; + DEVELOPMENT_TEAM = D5VMCLD3ZK; + ENABLE_HARDENED_RUNTIME = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ShortcutCommand/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = ShortcutCommand; + INFOPLIST_KEY_NSHumanReadableCopyright = "Developed by SBAREX (2019-2024)."; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@executable_path/../../../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 15.0; + MARKETING_VERSION = 2.1.32; + PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.ShortcutCommand; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + REGISTER_APP_GROUPS = YES; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; }; name = Release; }; + 83FDB5342D10493D00D55608 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + DEBUGGING_SYMBOLS = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 12.0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 83FDB5352D10493D00D55608 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu17; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACOSX_DEPLOYMENT_TARGET = 12.0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 832F7E5A2E054B8E0015DBBC /* Build configuration list for PBXNativeTarget "settings_chk" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 832F7E5B2E054B8E0015DBBC /* Debug */, + 832F7E5C2E054B8E0015DBBC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 83592340235599F6001506B6 /* Build configuration list for PBXProject "SourceCodeSyntaxHighlight" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -2277,11 +2831,29 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 83FD6EDA246B061600F5BDF3 /* Build configuration list for PBXNativeTarget "relaunch" */ = { + 83A25C6D2D1E06CC00C8B349 /* Build configuration list for PBXLegacyTarget "extra_resources" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83A25C6E2D1E06CC00C8B349 /* Debug */, + 83A25C6F2D1E06CC00C8B349 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83ABC9C92D1BF61900CF8972 /* Build configuration list for PBXNativeTarget "Syntax Hightlight Shortcut Action" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83ABC9C62D1BF61900CF8972 /* Debug */, + 83ABC9C72D1BF61900CF8972 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83FDB5332D10493D00D55608 /* Build configuration list for PBXLegacyTarget "yaml checker" */ = { isa = XCConfigurationList; buildConfigurations = ( - 83FD6ED4246B061600F5BDF3 /* Debug */, - 83FD6ED5246B061600F5BDF3 /* Release */, + 83FDB5342D10493D00D55608 /* Debug */, + 83FDB5352D10493D00D55608 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -2293,8 +2865,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/sparkle-project/Sparkle"; requirement = { - branch = 2.x; - kind = branch; + kind = upToNextMajorVersion; + minimumVersion = 2.9.0; }; }; 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */ = { @@ -2302,17 +2874,27 @@ repositoryURL = "https://github.com/jpsim/Yams"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 5.0.0; + minimumVersion = 6.0.0; }; }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 832F7E5D2E054B9F0015DBBC /* Yams */ = { + isa = XCSwiftPackageProductDependency; + package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */; + productName = Yams; + }; 8342C90D277EF4340018FCD8 /* Sparkle */ = { isa = XCSwiftPackageProductDependency; package = 8342C90C277EF4340018FCD8 /* XCRemoteSwiftPackageReference "Sparkle" */; productName = Sparkle; }; + 83632E802F8E2BA5008B95DE /* Yams */ = { + isa = XCSwiftPackageProductDependency; + package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */; + productName = Yams; + }; 836CD77F283024BF00F074CB /* Yams */ = { isa = XCSwiftPackageProductDependency; package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */; @@ -2333,6 +2915,11 @@ package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */; productName = Yams; }; + 83ABC9CB2D1BF64700CF8972 /* Yams */ = { + isa = XCSwiftPackageProductDependency; + package = 836CD77E283024BF00F074CB /* XCRemoteSwiftPackageReference "Yams" */; + productName = Yams; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 8359233D235599F6001506B6 /* Project object */; diff --git a/SourceCodeSyntaxHighlight.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/SourceCodeSyntaxHighlight.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 9cdf5e17..6f2f7225 100644 --- a/SourceCodeSyntaxHighlight.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/SourceCodeSyntaxHighlight.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,12 +1,13 @@ { + "originHash" : "15968c5bad8d4865dd1b180983f5457041ce820d0ebeb16cc3e861da762c4bfc", "pins" : [ { "identity" : "sparkle", "kind" : "remoteSourceControl", "location" : "https://github.com/sparkle-project/Sparkle", "state" : { - "branch" : "2.x", - "revision" : "f0ceaf5cc9f3f23daa0ccb6dcebd79fc96ccc7d9" + "revision" : "066e75a8b3e99962685d6a90cdd5293ebffd9261", + "version" : "2.9.1" } }, { @@ -14,10 +15,10 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/jpsim/Yams", "state" : { - "revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", - "version" : "5.0.6" + "revision" : "deaf82e867fa2cbd3cd865978b079bfcf384ac28", + "version" : "6.2.1" } } ], - "version" : 2 + "version" : 3 } diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/QLSourceSyntaxGUITest.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/QLSourceSyntaxGUITest.xcscheme index e48cac02..023810e4 100644 --- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/QLSourceSyntaxGUITest.xcscheme +++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/QLSourceSyntaxGUITest.xcscheme @@ -1,6 +1,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight Quicklook Extension.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight Quicklook Extension.xcscheme index e436d930..dce4bf96 100644 --- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight Quicklook Extension.xcscheme +++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight Quicklook Extension.xcscheme @@ -1,6 +1,6 @@ diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight XPC Render.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight XPC Render.xcscheme index 46c07207..cffdd5b9 100644 --- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight XPC Render.xcscheme +++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/Syntax Highlight XPC Render.xcscheme @@ -1,6 +1,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/relaunch.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/relaunch.xcscheme index de34774f..8c8b7f44 100644 --- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/relaunch.xcscheme +++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/relaunch.xcscheme @@ -1,6 +1,6 @@ + LastUpgradeVersion = "2700" + version = "1.7"> + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic"> @@ -26,9 +27,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> - - + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> + allowLocationSimulation = "YES" + viewDebuggingEnabled = "No"> - - - - - - + + + + diff --git a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/syntax_highlight_cli.xcscheme b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/syntax_highlight_cli.xcscheme index 3fb81fe7..3c5b8c27 100644 --- a/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/syntax_highlight_cli.xcscheme +++ b/SourceCodeSyntaxHighlight.xcodeproj/xcshareddata/xcschemes/syntax_highlight_cli.xcscheme @@ -1,6 +1,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SyntaxHighlightRenderXPC/ColorizeArgument.swift b/SyntaxHighlightRenderXPC/ColorizeArgument.swift index 396d5729..0f8f72dc 100644 --- a/SyntaxHighlightRenderXPC/ColorizeArgument.swift +++ b/SyntaxHighlightRenderXPC/ColorizeArgument.swift @@ -7,6 +7,7 @@ // import Foundation +import AppKit struct ColorizeArguments { /// Path of the `highlight` executable. @@ -70,6 +71,16 @@ struct ColorizeArguments { } } + if custom_settings.isAboutVisible { + env["SH_NAME"] = Settings.appName + env["SH_VERSION"] = Settings.appVersion + env["SH_COPYRIGHT"] = Settings.appCopyright + env["SH_URL"] = Settings.appLink + + hlArguments.arguments.append("--plug-in=about") + try? "Highlight plugin: about.lua".appendLine(to: custom_settings.logFile) + } + if custom_settings.isVCS && !custom_settings.vcsDiff.isEmpty { // Set the env used by the vcs plugin. env["VCS_DIFF"] = custom_settings.vcsDiff.joined(separator: " ") @@ -122,7 +133,8 @@ struct ColorizeArguments { cssCode += "\n" } do { - cssCode += try String(contentsOf: style) + var enc: String.Encoding = .utf8 + cssCode += try String(contentsOf: style, usedEncoding: &enc) try? "CSS: \(style.path)".appendLine(to: custom_settings.logFile) } catch { try? "ERROR: unable to read the CSS file `\(style.path)`".appendLine(to: custom_settings.logFile) diff --git a/SyntaxHighlightRenderXPC/Info.plist b/SyntaxHighlightRenderXPC/Info.plist index 760b1407..d1b5c064 100644 --- a/SyntaxHighlightRenderXPC/Info.plist +++ b/SyntaxHighlightRenderXPC/Info.plist @@ -21,7 +21,7 @@ CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright - Developed by SBAREX (2019-2024). + Developed by SBAREX (2019-2026). XPCService ServiceType diff --git a/SyntaxHighlightRenderXPC/MagicAttributes.swift b/SyntaxHighlightRenderXPC/MagicAttributes.swift index 0db48c88..c5ef9490 100644 --- a/SyntaxHighlightRenderXPC/MagicAttributes.swift +++ b/SyntaxHighlightRenderXPC/MagicAttributes.swift @@ -7,6 +7,7 @@ // import Foundation +import UniformTypeIdentifiers // MARK: - class MagicAttributes { @@ -23,46 +24,82 @@ class MagicAttributes { } else if components.first?.contains("text") ?? false { return true } else { - if let UType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, kUTTypeData)?.takeRetainedValue() { - return UTTypeConformsTo(UType, kUTTypeText) + if #available(macOS 11.0, *) { + return UTType(mimeType: mimeType)?.conforms(to: UTType.text) ?? false } else { - return false + if let UType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, kUTTypeData)?.takeRetainedValue() { + return UTTypeConformsTo(UType, kUTTypeText) + } else { + return false + } } } }() func checkMime(conformTo uttype: CFString) -> Bool { - if let UType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, kUTTypeData)?.takeRetainedValue() { - return UTTypeConformsTo(UType, uttype) + if #available(macOS 11.0, *) { + if let type = UTType(mimeType: mimeType), let t = UTType(uttype as String) { + return type.conforms(to: t) + } else { + return false + } } else { - return false + if let UType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType as CFString, kUTTypeData)?.takeRetainedValue() { + return UTTypeConformsTo(UType, uttype) + } else { + return false + } } } + @available(macOS 11.0, *) + func checkMime(conformTo uttype: UTType) -> Bool { + if let type = UTType(mimeType: mimeType) { + return type.conforms(to: uttype) + } + return false + } + /// Return if the parsed file is an image. lazy var isImage: Bool = { - return checkMime(conformTo: kUTTypeImage) + if #available(macOS 11.0, *) { + return checkMime(conformTo: UTType.image) + } else { + return checkMime(conformTo: kUTTypeImage) + } }() /// Return if the parsed file is an image. var isPDF: Bool { if self.mimeType == "application/pdf" { return true } else { - return checkMime(conformTo: kUTTypePDF) + if #available(macOS 11.0, *) { + return checkMime(conformTo: UTType.pdf) + } else { + return checkMime(conformTo: kUTTypePDF) + } } } var isMovie: Bool { if self.mimeType.hasPrefix("video/") { return true } else { - return checkMime(conformTo: kUTTypeVideo) + if #available(macOS 11.0, *) { + return checkMime(conformTo: UTType.video) + } else { + return checkMime(conformTo: kUTTypeVideo) + } } } var isAudio: Bool { if self.mimeType.hasPrefix("audio/") { return true } else { - return checkMime(conformTo: kUTTypeAudio) + if #available(macOS 11.0, *) { + return checkMime(conformTo: UTType.audio) + } else { + return checkMime(conformTo: kUTTypeAudio) + } } } diff --git a/SyntaxHighlightRenderXPC/SCSHBaseXPCService.swift b/SyntaxHighlightRenderXPC/SCSHBaseXPCService.swift index 202e7fdb..749ea376 100644 --- a/SyntaxHighlightRenderXPC/SCSHBaseXPCService.swift +++ b/SyntaxHighlightRenderXPC/SCSHBaseXPCService.swift @@ -23,6 +23,7 @@ import Foundation import Cocoa import OSLog +import UniformTypeIdentifiers @objc class SCSHBaseXPCService: NSObject { @@ -189,6 +190,8 @@ class SCSHBaseXPCService: NSObject { defer { if let logFile = custom_settings.logFile { var log = ""; + log += "OS Appearance: \(custom_settings.isOSThemeLight() ? "light" : "dark")" + // Log the custom theme. if let theme = colorize.inlineTheme, !theme.isEmpty { log += "\n\n#######\n# Custom Theme:\n\(theme)\n\n#######" @@ -353,9 +356,17 @@ class SCSHBaseXPCService: NSObject { uti = plain!.UTI } - if uti=="auto" || uti == nil, let attributes = attributes, let utiType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, attributes.mimeType as CFString, nil)?.takeRetainedValue() { - // Set the uti from the recognized mime. - uti = utiType as String + if uti=="auto" || uti == nil, let attributes = attributes { + if #available(macOS 11.0, *) { + if let u = UTType(mimeType: attributes.mimeType) { + uti = u.identifier + } + } else { + if let utiType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, attributes.mimeType as CFString, nil)?.takeRetainedValue() { + // Set the uti from the recognized mime. + uti = utiType as String + } + } } var syntax = "auto" if plain == nil || plain?.syntax == "auto", let u = uti { @@ -655,7 +666,7 @@ img { } do { try? "Getting the git status…".appendLine(to: logFile) - try? "\(git) diff -U0 -0 \(url.path)".appendLine(to: logFile) + try? "\(git) diff -U0 \(url.path)".appendLine(to: logFile) let result = try ShellTask.runTask(command: git, arguments: ["diff", "-U0", "-0", url.path], cwd: url.deletingLastPathComponent().path) diff --git a/SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements b/SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements index d0fdb1d3..a25de355 100644 --- a/SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements +++ b/SyntaxHighlightRenderXPC/Syntax Highlight XPC Render.entitlements @@ -2,6 +2,10 @@ + com.apple.security.application-groups + + group.org.sbarex.syntaxhighlight + com.apple.security.get-task-allow com.apple.security.temporary-exception.files.home-relative-path.read-write diff --git a/SyntaxHighlightRenderXPC/XPCLightRenderService.swift b/SyntaxHighlightRenderXPC/XPCLightRenderService.swift index 091fbb90..3e38ca67 100644 --- a/SyntaxHighlightRenderXPC/XPCLightRenderService.swift +++ b/SyntaxHighlightRenderXPC/XPCLightRenderService.swift @@ -29,10 +29,15 @@ import AppKit class XPCLightRenderService: SCSHBaseXPCService, XPCLightRenderServiceProtocol { lazy var highlightLanguages: [String: [String]] = { guard let file = Bundle.main.url(forResource: "languages", withExtension: "json") else { - print("missing file") + os_log(.error, log: self.log, "Missing languages.json file on the main Bundle!") + return [:] + } + do { + return try type(of: self).parseHighlightLanguages(file: file) + } catch { + os_log(.error, log: self.log, "Unable to parse %{public}@: %{public}@", file.path, error.localizedDescription) return [:] } - return (try? type(of: self).parseHighlightLanguages(file: file)) ?? [:] }() func reloadSettings() { diff --git a/SyntaxHighlightRenderXPC/languages.json b/SyntaxHighlightRenderXPC/languages.json index 3470ece5..13f543f9 100644 --- a/SyntaxHighlightRenderXPC/languages.json +++ b/SyntaxHighlightRenderXPC/languages.json @@ -35,6 +35,7 @@ "Backus-Naur Form": ["bnf"], "Boo": ["boo"], "C and C++": ["c", "c++", "cc", "cpp", "cu", "cxx", "h", "hh", "hpp", "hxx"], + "Carbon": ["carbon"], "Ceylon": ["ceylon"], "Charmm": ["charmm", "inp"], "CHILL": ["chill", "chl"], @@ -49,12 +50,16 @@ "Coffeescript": ["coffeescript"], "ColdFusion MX": ["coldfusion", "cfc", "cfm"], "Generic config files": ["conf", "anacrontab"], + "Cpp2": ["cpp2"], + "CriticMarkup": ["critic"], "Crack": ["crk"], "Crystal": ["crystal", "cr"], "Coffeescript Block Regex": ["cs_block_regex"], "CriticMarkup": ["critic"], "C#": ["csharp", "cs"], + "C# Unity": ["csharp_unity"], "CSS": ["css"], + "CUE": ["cue"], "D": ["d"], "Dart": ["dart"], "delphi": ["delphi", "dpr pas"], @@ -66,6 +71,7 @@ "EBNF2": ["ebnf2"], "Eiffel": ["eiffel", "e", "se"], "Elixir": ["elixir", "ex", "exs"], + "Elm": ["elm"], "E-Mail treated as Markup": ["email"], "ERB Templates": ["erb"], "Erlang": ["erlang", "erl", "hrl"], @@ -73,8 +79,10 @@ "EXAPUNKS": ["exapunks", "exa", "exapunks"], "Excel Formulas": ["excel"], "Express": ["express", "exp"], + "Factor": ["factor"], "FAME": ["fame", "fame"], "fasm": ["fasm", "inc"], + "OpenType Feature File": ["fea"], "Felix": ["felix", "flx"], "Fish": ["fish"], "Fortran 77": ["fortran77", "f", "for", "ftn"], @@ -86,6 +94,7 @@ "Gambas": ["gambas", "class"], "gdb": ["gdb"], "GDScript": ["gdscript", "gd"], + "Gleam": ["gleam"], "Go": ["go"], "Graphviz": ["graphviz", "dot"], "Haml (HTML Abstraction Markup Language)": ["haml"], @@ -100,11 +109,13 @@ "IDL": ["idl"], "Interactive Data Language": ["idlang"], "Lua (for LuaTeX)": ["inc_luatex"], + "Svelte template block (nested in svelte.lang)": ["inc_svelteblock"], "Informix": ["informix", "4gl"], "INI": ["ini", "desktop", "doxyfile", "kdev3"], "Inno Setup": ["innosetup", "iss"], "INTERLIS": ["interlis", "ili"], "IO": ["io"], + "Jam": ["jam", "ham", "jam"], "Jasmin": ["jasmin", "j"], "Java": ["java", "gradle", "groovy", "grv", "jenkinsfile"], "Javascript": ["javascript"], @@ -113,6 +124,7 @@ "JavaServer Pages": ["jsp"], "JSX": ["jsx"], "Julia": ["julia", "jl"], + "KDL": ["kdl"], "Kotlin": ["kotlin", "kt"], "LDAP": ["ldif"], "LESS": ["less"], @@ -120,7 +132,7 @@ "Lilypond": ["lilypond", "ly"], "Limbo": ["limbo", "b"], "Linden Script": ["lindenscript", "lsl"], - "Lisp": ["lisp", "cl", "clisp", "el", "fas", "lsp", "sbcl", "scm", "scom"], + "Lisp": ["lisp", "cl", "clisp", "el", "fas", "lsp", "sbcl", "scm", "scom", "ss", "sls", "sps", "sld", "sch","rkt"], "Logtalk": ["logtalk", "lgt"], "Lotos": ["lotos"], "Lotus": ["lotus", "ls"], @@ -133,16 +145,18 @@ "Maya": ["maya", "mel"], "Mercury": ["mercury"], "Meson": ["meson"], + "MiniScript": ["ms"], "Miranda": ["miranda"], "Modula2": ["mod2", "def", "mod"], "Modula3": ["mod3", "i3", "m3"], "Modelica": ["modelica", "mo"], + "Mojo": ["mojo"], "MoonScript": ["moon"], "MaxScript": ["ms"], "mIRC Scripting": ["msl", "nbs"], "MSSQL": ["mssql"], "Magic eXtensible Markup": ["mxml"], - "N-Triples, Turtle, SPARQL": ["nt", "ttl"], + "Notation3 (N3), N-Triples, Turtle, SPARQL": ["n3", "nt", "ttl"], "Nasal": ["nasal", "nas"], "NeXT Byte Codes": ["nbc"], "Nemerle": ["nemerle", "n"], @@ -165,7 +179,7 @@ "Pascal": ["pas"], "Portable Document Format": ["pdf"], "Perl": ["perl", "cgi", "perl", "pl", "plex", "plx", "pm"], - "PHP": ["php", "php3", "php4", "php5", "php6"], + "PHP": ["php", "php3", "php4", "php5", "php6", "php7", "phps", "phpt"], "Pike": ["pike", "pmod"], "PL/1": ["pl1", "bdy", "ff", "fp", "fpp", "rpp", "sf", "sp", "spb", "spe", "spp", "sps", "wf", "wp", "wpb", "wpp", "wps"], "PL/Perl": ["plperl"], @@ -178,13 +192,13 @@ "Microsoft PowerShell": ["powershell"], "Prolog": ["pro", "pro"], "Progress": ["progress", "p", "w"], - "purescript": ["purs", "pureScript"], "PostScript": ["ps"], "PATROL": ["psl"], "Pure": ["pure"], "PureBASIC": ["purebasic", "pb", "pbf", "pbi"], + "PureScript": ["purs", "pureScript"], "Pyrex": ["pyrex", "pyx"], - "Python": ["python", "py"], + "Python": ["python", "cpy", "gyp", "gypi", "pxd", "pxi", "py", "py3", "pyi", "pyw", "rpy", "sconstruct", "snakefile", "wscript"], "Qore": ["q"], "QMake Project": ["qmake"], "QML": ["qml"], @@ -197,8 +211,8 @@ "RPG": ["rpg"], "RPL Programming Language": ["rpl"], "reStructured Text": ["rst"], - "Ruby": ["ruby", "gemfile", "pp", "rakefile", "rb", "rjs", "ruby"], - "Rust": ["rust"], + "Ruby": ["appfile", "appraisals", "berksfile", "brewfile", "capfile", "cheffile", "config.ru", "deliverfile", "fastfile", "fcgi", "gemfile", "gemspec", "guardfile", "irbrc", "jbuilder", "podfile", "podspec", "pp", "prawn", "rabl", "rake", "rakefile", "rantfile", "rb", "rbx", "rjs", "ruby", "scanfile", "simplecov", "snapfile", "thor", "thorfile", "vagrantfile"], + "Rust": ["rust", "rs"], "PowerPC Assembler": ["s"], "Sequence Alignment Map (use with sam_seq.lua plug-in)": ["sam"], "SAS": ["sas"], @@ -206,7 +220,7 @@ "Scala": ["scala"], "Scilab": ["scilab", "sce", "sci"], "SASS/SCSS": ["scss"], - "Bash": ["shellscript"], + "Bash": ["shellscript", "bash", "ebuild", "eclass", "sh", "zsh"], "Slim (experimental)": ["slim"], "SMALL": ["small", "sma"], "Smalltalk": ["smalltalk", "gst", "sq", "st"], @@ -219,6 +233,7 @@ "PL/SQL": ["sql"], "Squirrel": ["squirrel", "nut"], "Stylus": ["styl"], + "Svelte": ["svelte"], "SVG": ["svg"], "Swift": ["swift"], "Sybase SQL": ["sybase"], @@ -231,8 +246,9 @@ "TSX (TypeScript with React)": ["tsx"], "TTCN3": ["ttcn3"], "Plain text": ["txt", "text"], - "TypeScript": ["typescript"], + "TypeScript": ["typescript", "ts"], "UPC (and C, technically)": ["upc"], + "V": ["v"], "Vala": ["vala"], "Visual Basic": ["vb", "bas", "basic", "bi", "vbs"], "Verilog": ["verilog", "v"], @@ -245,8 +261,8 @@ "XML": ["xml", "csproj", "dtd", "ecf", "ent", "glade", "hdr", "hub", "jnlp", "nrm", "resx", "sgm", "sgml", "tld", "vxml", "wml", "xsd", "xsl"], "SuperX++": ["xpp"], "Yaiff": ["yaiff"], - "Ansible YAML": ["yaml", "yml"], - "Jam": ["jam", "ham"], + "Generic YAML": ["yaml", "yml"], + "Ansible YAML": ["yaml_ansible"], "Yang": ["yang"], "Zig": ["zig"], "Zonnon": ["znn"] diff --git a/TODO.md b/TODO.md index a0ef76df..20fe9121 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,37 @@ -# TODO +# TODO - [ ] When compiling `highlight` avoid the creation of the static library `.a` before the CLI otherwise it will be linked in the executable instead of the dynamic one taking up space. -- [ ] Sometime when compiling the app the custom lua plugins are not embedded. +- [x] Sometime when compiling the app the custom lua plugins are not embedded. - [ ] Update the application help. - [ ] Consider whether to incorporate both light and dark styles in the html in order to automatically adapt to the system's style. For RTF [see this link](https://eclecticlight.co/2018/12/10/rendering-rich-text-in-dark-mode/). + + +# SPUNTI + +Nuovo qlsyntax + +- Usare app firmata e sandbox. Questo comporta la riscrittura delle preferenze +- Creare un groupcontainer condiviso tra app ed estensione in cui copiare le risorse di highlight +- Evitare l’uso di colorize.sh e usare tutto da codice nativo a meno che non venga richiesto un pre processore +- Gestire internamente alcuni preprocessori (come le plist binarie) +- Valutare di gestire git da codice nativo senza tool esterni. Eventualmente rimuovere supporto di hg +- Usare più appex con codice condiviso specializzati per determinate estensioni (ad esempio app, eseguibili o per i file senza estensioni) rendendo l’uso più modulare + +- usare una funzione che riceva uti ed estensione e restituisca la sintassi da usare per l'evidenziazione. +- Consentire di scegliere se l'output della quick look sia html o rtf (ottenuto dalla conversione dall'html) spiegando che rtf torna utile in certe modalità di anteprima (gallery? file info?) E valutare se il passaggio da html -> rtf sia molto peggiorativo della generazione diretta di codcie rtf + +Avere una vista dei file per estensione, per ogni estensione gli uti associati: +```swift +import UniformTypeIdentifiers + +let fileExtension = "jpg" + +let types = UTType.types(tag: fileExtension, + tagClass: .filenameExtension, + conformingTo: nil) + +for type in types { + print(type.identifier) +} + +``` diff --git a/Tests/PlainSettingsTests/main.swift b/Tests/PlainSettingsTests/main.swift new file mode 100644 index 00000000..66c66a4f --- /dev/null +++ b/Tests/PlainSettingsTests/main.swift @@ -0,0 +1,35 @@ +import Foundation + +private func expect(_ condition: @autoclosure () -> Bool, _ message: String) { + guard condition() else { + FileHandle.standardError.write(Data("FAIL: \(message)\n".utf8)) + exit(1) + } +} + +let shellScriptRule = PlainSettings( + patternFile: ".*", + patternMime: "^text/x-shellscript$", + isRegExp: true, + isCaseInsensitive: true, + UTI: "public.shell-script", + syntax: "shellscript" +) + +expect( + shellScriptRule.test(filename: "hproxy", mimeType: "text/x-shellscript"), + "MIME regex should use the complete MIME value for short filenames" +) +expect( + shellScriptRule.test( + filename: String(repeating: "extensionless-shell-script-", count: 4), + mimeType: "text/x-shellscript" + ), + "MIME regex should not use an out-of-bounds filename-derived range" +) +expect( + !shellScriptRule.test(filename: "script", mimeType: "text/x-python"), + "MIME regex should reject a different MIME type" +) + +print("PlainSettingsTests passed") diff --git a/Tests/PlainSettingsTests/run.sh b/Tests/PlainSettingsTests/run.sh new file mode 100755 index 00000000..2d98bdc5 --- /dev/null +++ b/Tests/PlainSettingsTests/run.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -eu + +script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +repo_root=$(dirname "$(dirname "$script_dir")") +test_binary=$(mktemp "${TMPDIR:-/tmp}/PlainSettingsTests.XXXXXX") +trap 'rm -f "$test_binary"' EXIT + +xcrun swiftc \ + "$repo_root/XPCService/PlainSettings.swift" \ + "$script_dir/main.swift" \ + -o "$test_binary" +"$test_binary" diff --git a/XPCService/Info.plist b/XPCService/Info.plist index 3d2b9616..0fbcd2ad 100644 --- a/XPCService/Info.plist +++ b/XPCService/Info.plist @@ -19,7 +19,7 @@ CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright - Developed by SBAREX (2019-2024). + Developed by SBAREX (2019-2026). XPCService ServiceType diff --git a/XPCService/PlainSettings.swift b/XPCService/PlainSettings.swift index 03619846..1021a98e 100644 --- a/XPCService/PlainSettings.swift +++ b/XPCService/PlainSettings.swift @@ -85,7 +85,7 @@ struct PlainSettings { guard let regex = self.mimeRegExp else { return false } - guard regex.firstMatch(in: mimeType, options: [], range: NSRange(filename.startIndex..., in: filename)) != nil else { + guard regex.firstMatch(in: mimeType, options: [], range: NSRange(mimeType.startIndex..., in: mimeType)) != nil else { return false } valid = true diff --git a/XPCService/SCSHTheme.swift b/XPCService/SCSHTheme.swift index 30577d87..4af62938 100644 --- a/XPCService/SCSHTheme.swift +++ b/XPCService/SCSHTheme.swift @@ -96,6 +96,8 @@ public class SCSHTheme: NSObject, Sequence { case lspRegexp case lspOperator + case indentGuide + case keyword(index: Int) public static var allCases: [PropertyName] { @@ -130,6 +132,8 @@ public class SCSHTheme: NSObject, Sequence { .lspNumber, .lspRegexp, .lspOperator, + + .indentGuide, .keyword(index: 0), .keyword(index: 1), @@ -185,6 +189,8 @@ public class SCSHTheme: NSObject, Sequence { case .lineNum: return "Line number" case .operator: return "Operator" case .interpolation: return "Interpolation" + + case .indentGuide: return "IndentGuide" case .keyword(let index): return "Keyword \(index+1)" @@ -226,6 +232,8 @@ public class SCSHTheme: NSObject, Sequence { case .lspError: return "Error" case .lspErrorMessage: return "ErrorMessage" + case .indentGuide: return "IndentGuide" + case .keyword(let index): return "Keyword \(index+1)" case .lspType: return "type" @@ -262,6 +270,9 @@ public class SCSHTheme: NSObject, Sequence { case .interpolation: return ["hl", "ipl"] + case .indentGuide: + return ["hl", "gui"] + case .keyword(let index): return ["hl", "kw" + String(UnicodeScalar(UInt8(97 + index)))] @@ -311,6 +322,9 @@ public class SCSHTheme: NSObject, Sequence { case "ipl": self = .interpolation + case "gui": + self = .indentGuide + case "sta": self = .lspType case "stb": @@ -889,6 +903,9 @@ public class SCSHTheme: NSObject, Sequence { return self.operatorProp case .interpolation: return self.interpolation + + case .indentGuide: + return self.indentGuide case .lspHover: return self.lspHover @@ -945,6 +962,8 @@ public class SCSHTheme: NSObject, Sequence { let operatorProp: Property let interpolation: Property + let indentGuide: CanvasProperty? + let lspHover: Property let lspError: Property let lspErrorMessage: Property @@ -983,7 +1002,7 @@ public class SCSHTheme: NSObject, Sequence { } } - public init(name: String, desc: String, categories: Set, plain: Property, canvas: CanvasProperty, number: Property, string: Property, escape: Property, preProcessor: Property, stringPreProc: Property, blockComment: Property, lineComment: Property, lineNum: Property, operatorProp: Property, interpolation: Property, hover: Property, error: Property, errorMessage: Property, lspType: Property, lspClass: Property, lspStruct: Property, lspInterface: Property, lspParameter: Property, lspVariable: Property, lspEnumMember: Property, lspFunction: Property, lspMethod: Property, lspKeyword: Property, lspNumber: Property, lspRegexp: Property, lspOperator: Property, keywords: [Property]) { + public init(name: String, desc: String, categories: Set, plain: Property, canvas: CanvasProperty, number: Property, string: Property, escape: Property, preProcessor: Property, stringPreProc: Property, blockComment: Property, lineComment: Property, lineNum: Property, operatorProp: Property, interpolation: Property, hover: Property, error: Property, errorMessage: Property, lspType: Property, lspClass: Property, lspStruct: Property, lspInterface: Property, lspParameter: Property, lspVariable: Property, lspEnumMember: Property, lspFunction: Property, lspMethod: Property, lspKeyword: Property, lspNumber: Property, lspRegexp: Property, lspOperator: Property, keywords: [Property], indentGuide: CanvasProperty? = nil) { self.name = name self.desc = desc self.categories = categories @@ -1001,6 +1020,8 @@ public class SCSHTheme: NSObject, Sequence { self.operatorProp = operatorProp self.interpolation = interpolation + self.indentGuide = indentGuide + self.lspHover = hover self.lspError = error self.lspErrorMessage = errorMessage @@ -1036,6 +1057,8 @@ public class SCSHTheme: NSObject, Sequence { self.operatorProp.theme = self self.interpolation.theme = self + self.indentGuide?.theme = self + self.lspHover.theme = self self.lspError.theme = self self.lspErrorMessage.theme = self @@ -1059,7 +1082,7 @@ public class SCSHTheme: NSObject, Sequence { } convenience public init(name: String) { - self.init(name: name, desc: "", categories: ["light"], plain: Property(color: "#000000"), canvas: CanvasProperty(color: "#ffffff"), number: Property(), string: Property(), escape: Property(), preProcessor: Property(), stringPreProc: Property(), blockComment: Property(), lineComment: Property(), lineNum: Property(), operatorProp: Property(), interpolation: Property(), hover: Property(), error: Property(), errorMessage: Property(), lspType: Property(), lspClass: Property(), lspStruct: Property(), lspInterface: Property(), lspParameter: Property(), lspVariable: Property(), lspEnumMember: Property(), lspFunction: Property(), lspMethod: Property(), lspKeyword: Property(), lspNumber: Property(), lspRegexp: Property(), lspOperator: Property(), keywords: []) + self.init(name: name, desc: "", categories: ["light"], plain: Property(color: "#000000"), canvas: CanvasProperty(color: "#ffffff"), number: Property(), string: Property(), escape: Property(), preProcessor: Property(), stringPreProc: Property(), blockComment: Property(), lineComment: Property(), lineNum: Property(), operatorProp: Property(), interpolation: Property(), hover: Property(), error: Property(), errorMessage: Property(), lspType: Property(), lspClass: Property(), lspStruct: Property(), lspInterface: Property(), lspParameter: Property(), lspVariable: Property(), lspEnumMember: Property(), lspFunction: Property(), lspMethod: Property(), lspKeyword: Property(), lspNumber: Property(), lspRegexp: Property(), lspOperator: Property(), keywords: [], indentGuide: nil) } convenience public init?(dict dictionary: [String: Any]?) { @@ -1107,6 +1130,8 @@ public class SCSHTheme: NSObject, Sequence { return nil } + let indentGuide = CanvasProperty(dict: dict[PropertyName.indentGuide.name] as? [String: Any]) + guard let lspHover = Property(dict: dict[PropertyName.lspHover.name] as? [String: Any]) else { return nil } @@ -1166,7 +1191,7 @@ public class SCSHTheme: NSObject, Sequence { } } - self.init(name: name, desc: desc, categories: categories, plain: plain, canvas: canvas, number: number, string: string, escape: escape, preProcessor: preProcessor, stringPreProc: stringPreProc, blockComment: blockComment, lineComment: lineComment, lineNum: lineNum, operatorProp: operatorProp, interpolation: interpolation, hover: lspHover, error: lspError, errorMessage: lspErrorMessage, lspType: lspType, lspClass: lspClass, lspStruct: lspStruct, lspInterface: lspInterface, lspParameter: lspParameter, lspVariable: lspVariable, lspEnumMember: lspEnumMember, lspFunction: lspFunction, lspMethod: lspMethod, lspKeyword: lspKeyword, lspNumber: lspNumber, lspRegexp: lspRegexp, lspOperator: lspOperator, keywords: keywords) + self.init(name: name, desc: desc, categories: categories, plain: plain, canvas: canvas, number: number, string: string, escape: escape, preProcessor: preProcessor, stringPreProc: stringPreProc, blockComment: blockComment, lineComment: lineComment, lineNum: lineNum, operatorProp: operatorProp, interpolation: interpolation, hover: lspHover, error: lspError, errorMessage: lspErrorMessage, lspType: lspType, lspClass: lspClass, lspStruct: lspStruct, lspInterface: lspInterface, lspParameter: lspParameter, lspVariable: lspVariable, lspEnumMember: lspEnumMember, lspFunction: lspFunction, lspMethod: lspMethod, lspKeyword: lspKeyword, lspNumber: lspNumber, lspRegexp: lspRegexp, lspOperator: lspOperator, keywords: keywords, indentGuide: indentGuide) self.path = dict["path"] as? String ?? "" self.isDirty = false @@ -1176,7 +1201,7 @@ public class SCSHTheme: NSObject, Sequence { } public func toDictionary() -> [String: AnyHashable] { - let dict: [String: AnyHashable] = [ + var dict: [String: AnyHashable] = [ "name": name, "desc": desc, "categories": categories, @@ -1217,6 +1242,10 @@ public class SCSHTheme: NSObject, Sequence { "standalone": isStandalone, ] + if let indentGuide { + dict[PropertyName.indentGuide.name] = indentGuide.toDictionary() + } + return dict } @@ -1269,6 +1298,10 @@ public class SCSHTheme: NSObject, Sequence { s += PropertyName.operator.luaName + " = " + operatorProp.output() + "\n" s += PropertyName.interpolation.luaName + " = " + interpolation.output() + "\n" + if let indentGuide { + s += PropertyName.indentGuide.luaName + " = " + indentGuide.output() + "\n" + } + s += PropertyName.lspHover.luaName + " = " + lspHover.output() + "\n" s += PropertyName.lspError.luaName + " = " + lspError.output() + "\n" s += PropertyName.lspErrorMessage.luaName + " = " + lspErrorMessage.output() + "\n" @@ -1320,6 +1353,10 @@ public class SCSHTheme: NSObject, Sequence { css += formatPropertyCss(.operator, self.operatorProp) css += formatPropertyCss(.interpolation, self.interpolation) + if let indentGuide { + css += formatPropertyCss(.indentGuide, indentGuide) + } + for (i, keyword) in self.keywords.enumerated() { css += formatPropertyCss(.keyword(index: i), keyword) } diff --git a/XPCService/Settings+Service.swift b/XPCService/Settings+Service.swift index 6ae64208..dce1dafc 100644 --- a/XPCService/Settings+Service.swift +++ b/XPCService/Settings+Service.swift @@ -93,36 +93,64 @@ extension Settings: SettingsCSS { self.isAllSpecialSettingsPopulated = true // Process files on bundle the application support folder. - if let p = serviceBundle.url(forResource: "settings", withExtension: "yaml"), let data = try? String(contentsOf: p) { + var enc: String.Encoding = .utf8 + if let p = serviceBundle.url(forResource: "settings", withExtension: "yaml"), let data = try? String(contentsOf: p, usedEncoding: &enc) { do { - if let d = try Yams.load(yaml: data) as? [String: [String: [String: String]]] { - self.specialSettings = d + if let raw_d = try Yams.load(yaml: data) { + if let d = raw_d as? [String: [String: [String: String]]] { + self.specialSettings = d + } else { + if #available(macOS 13.0, *) { + os_log(OSLogType.error, "Settings %{public}s is not valid!", p.path(percentEncoded: false)) + } else { + os_log(OSLogType.error, "Settings %{public}s is not valid!", p.path) + } + } } } catch { + if #available(macOS 13.0, *) { + os_log(OSLogType.error, "Settings %{public}s is not valid yaml file!", p.path(percentEncoded: false)) + } else { + os_log(OSLogType.error, "Settings %{public}s is not valid yaml file!", p.path) + } print(error) } } // Process files on support folder. - if let p = supportFolder?.appendingPathComponent("settings.yaml"), let data = try? String(contentsOf: p) { + enc = .utf8 + if let p = supportFolder?.appendingPathComponent("settings.yaml"), let data = try? String(contentsOf: p, usedEncoding: &enc) { do { - if let d = try Yams.load(yaml: data) as? [String: [String: [String: String]]] { - for group in d { - if self.specialSettings[group.key] == nil { - self.specialSettings[group.key] = [:] - } - for item in group.value { - if self.specialSettings[group.key]![item.key] == nil { - self.specialSettings[group.key]![item.key] = item.value - } else { - self.specialSettings[group.key]![item.key] = self.specialSettings[group.key]![item.key]?.merging(item.value, uniquingKeysWith: { _, new in - return new - }) + if let raw_d = try Yams.load(yaml: data) { + if let d = raw_d as? [String: [String: [String: String]]] { + for group in d { + if self.specialSettings[group.key] == nil { + self.specialSettings[group.key] = [:] } + for item in group.value { + if self.specialSettings[group.key]![item.key] == nil { + self.specialSettings[group.key]![item.key] = item.value + } else { + self.specialSettings[group.key]![item.key] = self.specialSettings[group.key]![item.key]?.merging(item.value, uniquingKeysWith: { _, new in + return new + }) + } + } + } + } else { + if #available(macOS 13.0, *) { + os_log(OSLogType.error, "Settings %{public}s is not valid!", p.path(percentEncoded: false)) + } else { + os_log(OSLogType.error, "Settings %{public}s is not valid!", p.path) } } } } catch { + if #available(macOS 13.0, *) { + os_log(OSLogType.error, "Settings %{public}s is not valid yaml file!", p.path(percentEncoded: false)) + } else { + os_log(OSLogType.error, "Settings %{public}s is not valid yaml file!", p.path) + } print(error) } } @@ -222,6 +250,8 @@ extension Settings: SettingsCSS { updateDomains(SettingsBase.Key.tabSpaces, tabSpaces) + updateDomains(SettingsBase.Key.indentGuides, indentGuides) + updateDomains(SettingsBase.Key.extraArguments, arguments) updateDomains(SettingsBase.Key.fontFamily, fontName) @@ -231,6 +261,7 @@ extension Settings: SettingsCSS { updateDomains(SettingsBase.Key.interactive, allowInteractiveActions) updateDomains(SettingsBase.Key.convertEOL, convertEOL) updateDomains(SettingsBase.Key.debug, isDebug) + updateDomains(SettingsBase.Key.about, isAboutVisible) updateDomains(SettingsBase.Key.dumpPlain, isDumpPlainData) updateDomains(SettingsBase.Key.vcs, isVCS) diff --git a/XPCService/Settings.swift b/XPCService/Settings.swift index 185988a9..e770f5c9 100644 --- a/XPCService/Settings.swift +++ b/XPCService/Settings.swift @@ -47,6 +47,8 @@ class SettingsBase: NSObject { static let tabSpaces = "tab-spaces" + static let indentGuides = "indent-guides" + static let extraArguments = "extra" static let fontFamily = "font-family" @@ -59,6 +61,7 @@ class SettingsBase: NSObject { static let convertEOL = "convert-EOL" static let version = "version" + static let about = "about" static let debug = "debug" static let dumpPlain = "dump" @@ -239,6 +242,21 @@ class SettingsBase: NSObject { } } + // MARK: Indentation guides + + dynamic var isIndentGuidesDefined: Bool { + didSet { + requestRefreshOnChanged(oldValue: oldValue, newValue: isIndentGuidesDefined) + } + } + + /// Show the indentation guides. + dynamic var indentGuides: Bool { + didSet { + requestRefreshOnChanged(oldValue: oldValue, newValue: indentGuides) + } + } + // MARK: CSS dynamic var isCSSDefined: Bool { @@ -366,7 +384,7 @@ class SettingsBase: NSObject { var isCustomized: Bool { get { - let state = isFormatDefined || isLightThemeNameDefined || isDarkThemeNameDefined || isLineNumbersDefined || isWordWrapDefined || isLineLengthDefined || isTabSpacesDefined || isArgumentsDefined || isCSSDefined || isFontSizeDefined || isVCSDefined + let state = isFormatDefined || isLightThemeNameDefined || isDarkThemeNameDefined || isLineNumbersDefined || isWordWrapDefined || isLineLengthDefined || isTabSpacesDefined || isIndentGuidesDefined || isArgumentsDefined || isCSSDefined || isFontSizeDefined || isVCSDefined guard !state else { return true @@ -419,6 +437,9 @@ class SettingsBase: NSObject { self.tabSpaces = 4 self.isTabSpacesDefined = false + self.indentGuides = false + self.isIndentGuidesDefined = false + self.css = "" self.isCSSDefined = false @@ -518,6 +539,11 @@ class SettingsBase: NSObject { self.isTabSpacesDefined = true } + if let s = settings[Settings.Key.indentGuides] as? Bool { + self.indentGuides = s + self.isIndentGuidesDefined = true + } + if let css = settings[SettingsBase.Key.customCSS] as? String { self.css = css self.isCSSDefined = !css.isEmpty @@ -612,6 +638,9 @@ class SettingsBase: NSObject { if isTabSpacesDefined { r[SettingsBase.Key.tabSpaces] = tabSpaces } + if isIndentGuidesDefined { + r[Settings.Key.indentGuides] = indentGuides + } if isArgumentsDefined { r[SettingsBase.Key.extraArguments] = arguments @@ -650,11 +679,13 @@ class SettingsBase: NSObject { } func isOSThemeLight() -> Bool { - if #available(macOS 11.0, *) { + /*if #available(macOS 11.0, *) { + // Fixme: nell'estensione non sempre restituisce il valore aggiornato. return NSAppearance.currentDrawing().bestMatch(from: [.aqua, .darkAqua]) ?? .aqua == .aqua } else { return (UserDefaults.standard.string(forKey: "AppleInterfaceStyle") ?? "Light") == "Light" - } + }*/ + return (UserDefaults.standard.string(forKey: "AppleInterfaceStyle") ?? "Light") == "Light" } func getTheme() -> ThemeBaseColor { @@ -987,6 +1018,38 @@ class Settings: SettingsBase { internal var plainSettings: [PlainSettings] = [] + static let appName: String = { + if let info = Bundle.main.infoDictionary, let name = info["CFBundleExecutable"] as? String { + return name + } else { + return "Syntax Highlight" + } + }() + + static let appVersion: String = { + if let info = Bundle.main.infoDictionary, let version = info["CFBundleShortVersionString"] as? String, let build = info["CFBundleVersion"] as? String { + return "\(version) [\(build)]" + } else { + return "" + } + }() + + static let appCopyright: String = { + if let info = Bundle.main.infoDictionary, let copy = info["NSHumanReadableCopyright"] as? String { + return copy.trimmingCharacters(in: CharacterSet(charactersIn: ". ")) + } else { + return "Developed by Sbarex" + } + }() + + static let appLink = "https://github.com/sbarex/SourceCodeSyntaxHighlight" + + dynamic var isAboutVisible: Bool = true { + didSet { + requestRefreshOnChanged(oldValue: oldValue, newValue: isAboutVisible) + } + } + dynamic var isDebug: Bool = false { didSet { requestRefreshOnChanged(oldValue: oldValue, newValue: isDebug) @@ -1074,6 +1137,7 @@ class Settings: SettingsBase { required internal init(settings: [String: AnyHashable]) { self.version = settings[SettingsBase.Key.version] as? Float ?? Settings.version + self.isAboutVisible = true self.isDebug = false self.isVCS = false @@ -1121,6 +1185,9 @@ class Settings: SettingsBase { super.override(fromDictionary: dict) + if let v = settings[SettingsBase.Key.about] as? Bool { + self.isAboutVisible = v + } if let v = settings[SettingsBase.Key.debug] as? Bool { self.isDebug = v } @@ -1168,6 +1235,7 @@ class Settings: SettingsBase { self.isLineLengthDefined = true self.isLineNumbersDefined = true self.isTabSpacesDefined = true + self.isIndentGuidesDefined = true self.isArgumentsDefined = true self.isCSSDefined = true self.isVCSDefined = true @@ -1189,6 +1257,7 @@ class Settings: SettingsBase { /// Output the settings to a dictionary. override func toDictionary(forSaving: Bool = false) -> [String: AnyHashable] { var r = super.toDictionary(forSaving: forSaving) + r[SettingsBase.Key.about] = self.isAboutVisible r[SettingsBase.Key.debug] = self.isDebug @@ -1527,6 +1596,10 @@ class Settings: SettingsBase { extraHLFlags.append("--replace-tabs=\(self.tabSpaces)") } + if self.isIndentGuidesDefined && self.indentGuides { + extraHLFlags.append("--indent-guide") + } + // Font family. if self.isFontNameDefined { if self.fontName.isEmpty || self.fontName == "-" { diff --git a/XPCService/TaskResult.swift b/XPCService/TaskResult.swift index 793d6a86..5ee65206 100644 --- a/XPCService/TaskResult.swift +++ b/XPCService/TaskResult.swift @@ -91,7 +91,7 @@ class ShellTask { } let data = file.readDataToEndOfFile() - let dataErr = file.readDataToEndOfFile() + let dataErr = fileErr.readDataToEndOfFile() task.waitUntilExit() diff --git a/XPCService/XPCServiceRelease.entitlements b/XPCService/XPCServiceRelease.entitlements index d0fdb1d3..a25de355 100644 --- a/XPCService/XPCServiceRelease.entitlements +++ b/XPCService/XPCServiceRelease.entitlements @@ -2,6 +2,10 @@ + com.apple.security.application-groups + + group.org.sbarex.syntaxhighlight + com.apple.security.get-task-allow com.apple.security.temporary-exception.files.home-relative-path.read-write diff --git a/dos2unix/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild b/dos2unix/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild new file mode 100644 index 00000000..ab527811 Binary files /dev/null and b/dos2unix/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild differ diff --git a/dos2unix/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache b/dos2unix/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache new file mode 100644 index 00000000..c5aa1cd2 Binary files /dev/null and b/dos2unix/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache differ diff --git a/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-arm64 b/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-arm64 new file mode 100755 index 00000000..d307651f Binary files /dev/null and b/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-arm64 differ diff --git a/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-x86_64 b/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-x86_64 new file mode 100755 index 00000000..4eccd3dc Binary files /dev/null and b/dos2unix/Highlight/BuildProductsPath/Release/dos2unix-x86_64 differ diff --git a/dos2unix/Makefile b/dos2unix/Makefile index 52733eec..c1c50821 100644 --- a/dos2unix/Makefile +++ b/dos2unix/Makefile @@ -6,10 +6,11 @@ CURRENT_DIR := $(subst $(SPACE),"\\ ",$(CURDIR)) ifeq ($(BUILT_PRODUCTS_DIR),) - BUILD_DIR :="${CURRENT_DIR}/build" + BUILD_DIR :=${CURRENT_DIR}/build else BUILD_DIR :=${BUILT_PRODUCTS_DIR} endif +BUILD_DIR_ESCAPED := $(subst $(SPACE),\ ,$(BUILD_DIR)) ifeq ($(ONLY_ACTIVE_ARCH),) ONLY_ACTIVE_ARCH=NO @@ -42,18 +43,18 @@ VALID_ARCHS:=x86_64 arm64 dos2unix_cli := ifeq ($(NATIVE_ARCH),x86_64) - dos2unix_cli += ${BUILD_DIR}/dos2unix-x86_64 + dos2unix_cli += ${BUILD_DIR_ESCAPED}/dos2unix-x86_64 else - dos2unix_cli += ${BUILD_DIR}/dos2unix-arm64 + dos2unix_cli += ${BUILD_DIR_ESCAPED}/dos2unix-arm64 endif ifeq ($(ONLY_ACTIVE_ARCH),NO) ifeq ($(NATIVE_ARCH),x86_64) # build arm code - dos2unix_cli += ${BUILD_DIR}/dos2unix-arm64 + dos2unix_cli += ${BUILD_DIR_ESCAPED}/dos2unix-arm64 else # build intel code - dos2unix_cli += ${BUILD_DIR}/dos2unix-x86_64 + dos2unix_cli += ${BUILD_DIR_ESCAPED}/dos2unix-x86_64 endif endif @@ -69,52 +70,60 @@ else endif @echo "" -#dos2unix_arm: ${BUILD_DIR}/arm/dos2unix -#dos2unix_intel: ${BUILD_DIR}/intel/dos2unix -cli: ${BUILD_DIR}/dos2unix +#dos2unix_arm: ${BUILD_DIR_ESCAPED}/arm/dos2unix +#dos2unix_intel: ${BUILD_DIR_ESCAPED}/intel/dos2unix +cli: ${BUILD_DIR_ESCAPED}/dos2unix -install: ${BUILD_DIR}/dos2unix +install: ${BUILD_DIR_ESCAPED}/dos2unix clean_dos2unix: @echo "${bold}Cleaning dos2unix...${normal}" ${MAKE} -e "Makefile" clean @echo "" -${BUILD_DIR}/dos2unix-arm64: | $(BUILD_DIR) - @echo "${bold}Building dos2unix for arm64 platform...${normal}" +$(BUILD_DIR_ESCAPED)/dos2unix-arm64: | $(BUILD_DIR_ESCAPED) + @echo "${bold}Building dos2unix for arm64 platform...${normal} to \"$@\"" @#${MAKE} -e "Makefile" clean ${MAKE} BUILD_DIR="build-arm-$(CONFIGURATION)" ENABLE_NLS= CC="gcc -std=gnu99 -target arm64-apple-macos11" CFLAGS="$(CFLAGS_arm64)" LDFLAGS="$(LDFLAGS_arm64)" -f "$(CURRENT_DIR)/build.makefile" - cp "build-arm-$(CONFIGURATION)/dos2unix" $@ + cp "build-arm-$(CONFIGURATION)/dos2unix" "$@" @echo "${bold}... OK${normal}" @echo "" -${BUILD_DIR}/dos2unix-x86_64: | $(BUILD_DIR) - @echo "${bold}Building dos2unix for intel platform...${normal}" +${BUILD_DIR_ESCAPED}/dos2unix-x86_64: | $(BUILD_DIR_ESCAPED) + @echo "${bold}Building dos2unix for intel platform...${normal} to \"$@\"" @#${MAKE} -e "Makefile" clean ${MAKE} BUILD_DIR="build-intel-$(CONFIGURATION)" ENABLE_NLS= CFLAGS="$(CFLAGS_x86_64)" LDFLAGS="$(LDFLAGS_x86_64)" -f "$(CURRENT_DIR)/build.makefile" - cp "build-intel-$(CONFIGURATION)/dos2unix" $@ + cp "build-intel-$(CONFIGURATION)/dos2unix" "$@" @echo "${bold}... OK${normal}" @echo "" -${BUILD_DIR}/dos2unix: $(BUILD_DIR) ${dos2unix_cli} +${BUILD_DIR_ESCAPED}/dos2unix: ${dos2unix_cli} | $(BUILD_DIR_ESCAPED) ifeq ($(ONLY_ACTIVE_ARCH),NO) - @#echo $(dos2unix_cli) + @#echo "$(dos2unix_cli)" @echo "${bold}Creating universal dos2unix...${normal}" - lipo -create -output $@ "${BUILD_DIR}/dos2unix-x86_64" "${BUILD_DIR}/dos2unix-arm64" + lipo -create -output "$@" ${BUILD_DIR_ESCAPED}/dos2unix-x86_64 ${BUILD_DIR_ESCAPED}/dos2unix-arm64 else @echo "${bold}Creating dos2unix for ${NATIVE_ARCH}...${normal}" @rm -f $@ > /dev/null ifeq ($(NATIVE_ARCH),x86_64) - ln -f "${BUILD_DIR}/dos2unix-x86_64" $@ + ln -f ${BUILD_DIR_ESCAPED}/dos2unix-x86_64 "$@" else - ln -f "${BUILD_DIR}/dos2unix-arm64" $@ + ln -f ${BUILD_DIR_ESCAPED}/dos2unix-arm64 "$@" endif endif @echo "${bold}... OK${normal}" + @echo "Code signing the dos2unix app" + /usr/bin/codesign --force --deep --sign "$(CODE_SIGN_IDENTITY)" \ + --options runtime \ + --entitlements $(CURRENT_DIR)/entitlements.entitlements \ + ${OTHER_CODE_SIGN_FLAGS} \ + "$@" + @echo "" -$(BUILD_DIR): - @echo "Current dir: $(CURRENT_DIR)." +$(BUILD_DIR_ESCAPED): + @echo "Current dir: $(CURRENT_DIR)" + @echo "Build dir: $(BUILD_DIR_ESCAPED)" - @echo "Creating build dir $(BUILD_DIR) ..." - mkdir -p $(BUILD_DIR) + @echo "Creating build dir \"$(BUILD_DIR)\" ..." + mkdir -p "$(BUILD_DIR)" @echo "" diff --git a/dos2unix/dos2unix.xcodeproj/project.pbxproj b/dos2unix/dos2unix.xcodeproj/project.pbxproj index 403491e1..caeeaac5 100644 --- a/dos2unix/dos2unix.xcodeproj/project.pbxproj +++ b/dos2unix/dos2unix.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXFileReference section */ @@ -83,7 +83,7 @@ /* Begin PBXLegacyTarget section */ 83257FD82638126E00A8888F /* dos2unix */ = { isa = PBXLegacyTarget; - buildArgumentsString = "$(ACTION)"; + buildArgumentsString = ""; buildConfigurationList = 83257FF82638126E00A8888F /* Build configuration list for PBXLegacyTarget "dos2unix" */; buildPhases = ( ); @@ -101,7 +101,8 @@ 83257FD42638126E00A8888F /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1250; + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 2700; }; buildConfigurationList = 83257FD72638126E00A8888F /* Build configuration list for PBXProject "dos2unix" */; compatibilityVersion = "Xcode 9.3"; @@ -143,8 +144,10 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -153,6 +156,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; + STRING_CATALOG_GENERATE_SYMBOLS = YES; }; name = Debug; }; @@ -178,7 +182,9 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -186,6 +192,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + STRING_CATALOG_GENERATE_SYMBOLS = YES; }; name = Release; }; @@ -194,6 +201,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUGGING_SYMBOLS = YES; GCC_DYNAMIC_NO_PIC = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -209,6 +217,7 @@ buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; diff --git a/dos2unix/dos2unix.xcodeproj/xcshareddata/xcschemes/dos2unix.xcscheme b/dos2unix/dos2unix.xcodeproj/xcshareddata/xcschemes/dos2unix.xcscheme index 65eda9b7..eff09828 100644 --- a/dos2unix/dos2unix.xcodeproj/xcshareddata/xcschemes/dos2unix.xcscheme +++ b/dos2unix/dos2unix.xcodeproj/xcshareddata/xcschemes/dos2unix.xcscheme @@ -1,6 +1,6 @@ + + + + com.apple.security.app-sandbox + + + diff --git a/highlight-wrapper/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild b/highlight-wrapper/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild new file mode 100644 index 00000000..ab527811 Binary files /dev/null and b/highlight-wrapper/27.0-27A266a/Xcode/CachedSpecifications-xcodebuild differ diff --git a/highlight-wrapper/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache b/highlight-wrapper/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache new file mode 100644 index 00000000..c5aa1cd2 Binary files /dev/null and b/highlight-wrapper/27.0-27A266a/Xcode/PlugInCache-xcodebuild.xcplugincache differ diff --git a/highlight-wrapper/Makefile b/highlight-wrapper/Makefile index 01b780b3..4b1a578f 100644 --- a/highlight-wrapper/Makefile +++ b/highlight-wrapper/Makefile @@ -17,24 +17,28 @@ ifeq ($(ONLY_ACTIVE_ARCH),) endif BUILD_DIR := $(BUILD_DIR)/highlight +BUILD_DIR_ESCAPED := $(subst $(SPACE),\ ,$(BUILD_DIR)) +CURRENT_DIR_ESCAPED := $(subst $(SPACE),\ ,$(CURRENT_DIR)) CXX=clang++ -CFLAGS=-Wall -std=c++11 -D_FILE_OFFSET_BITS=64 \ - -I "${CURRENT_DIR}/${HIGHLIGHT_DIR}/src/include" \ - -I "${CURRENT_DIR}/${LUA_DIR}/src" \ - -I "${CURRENT_DIR}" \ - -I "${BUILD_DIR}" -LDFLAGS="-L${BUILD_DIR}" - -CFLAGS_x86_64=-target x86_64-apple-macos10.15 -CFLAGS_arm64=-target arm64-apple-macos11 +CFLAGS= \ + -I ${CURRENT_DIR_ESCAPED}/${HIGHLIGHT_DIR}/src/include \ + -I ${CURRENT_DIR_ESCAPED}/${LUA_DIR}/src \ + -I ${CURRENT_DIR_ESCAPED} \ + -I ${BUILD_DIR_ESCAPED} \ + -Wno-deprecated-declarations -Wno-unknown-pragmas +CXXFLAGS += -std=c++17 +LDFLAGS=-L${BUILD_DIR_ESCAPED} + +CFLAGS_x86_64=-target x86_64-apple-macos12.0 +CFLAGS_arm64=-target arm64-apple-macos12.0 # ifneq ($(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/.*),) # CFLAGS_x86_64+=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk # endif -LDFLAGS_x86_64=-target x86_64-apple-macos10.15 -LDFLAGS_arm64=-target arm64-apple-macos11 +LDFLAGS_x86_64=-target x86_64-apple-macos12.0 +LDFLAGS_arm64=-target arm64-apple-macos12.0 ifeq ($(CONFIGURATION),Debug) CFLAGS_x86_64+= -g @@ -63,46 +67,46 @@ wrapper_lib_static = lua_libraries = ifeq ($(NATIVE_ARCH),x86_64) - lua_libraries += ${BUILD_DIR}/liblua-x86_64.a + lua_libraries += ${BUILD_DIR_ESCAPED}/liblua-x86_64.a - highlight_lib_static += ${BUILD_DIR}/libhighlight-x86_64.a - highlight_lib_shared += ${BUILD_DIR}/libhighlight-x86_64.dylib - highlight_cli += ${BUILD_DIR}/highlight-x86_64 + highlight_lib_static += ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.a + highlight_lib_shared += ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.dylib + highlight_cli += ${BUILD_DIR_ESCAPED}/highlight-x86_64 - wrapper_lib_shared += ${BUILD_DIR}/libwrapper_highlight-x86_64.dylib - wrapper_lib_static += ${BUILD_DIR}/libwrapper_highlight-x86_64.a + wrapper_lib_shared += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.dylib + wrapper_lib_static += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.a else - lua_libraries += ${BUILD_DIR}/liblua-arm64.a + lua_libraries += ${BUILD_DIR_ESCAPED}/liblua-arm64.a - highlight_lib_static += ${BUILD_DIR}/libhighlight-arm64.a - highlight_lib_shared += ${BUILD_DIR}/libhighlight-arm64.dylib - highlight_cli += ${BUILD_DIR}/highlight-arm64 + highlight_lib_static += ${BUILD_DIR_ESCAPED}/libhighlight-arm64.a + highlight_lib_shared += ${BUILD_DIR_ESCAPED}/libhighlight-arm64.dylib + highlight_cli += ${BUILD_DIR_ESCAPED}/highlight-arm64 - wrapper_lib_shared += ${BUILD_DIR}/libwrapper_highlight-arm64.dylib - wrapper_lib_static += ${BUILD_DIR}/libwrapper_highlight-arm64.a + wrapper_lib_shared += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.dylib + wrapper_lib_static += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.a endif ifeq ($(ONLY_ACTIVE_ARCH),NO) ifeq ($(NATIVE_ARCH),x86_64) # build arm code - lua_libraries += ${BUILD_DIR}/liblua-arm64.a + lua_libraries += ${BUILD_DIR_ESCAPED}/liblua-arm64.a - highlight_lib_static += ${BUILD_DIR}/libhighlight-arm64.a - highlight_lib_shared += ${BUILD_DIR}/libhighlight-arm64.dylib - highlight_cli += ${BUILD_DIR}/highlight-arm64 + highlight_lib_static += ${BUILD_DIR_ESCAPED}/libhighlight-arm64.a + highlight_lib_shared += ${BUILD_DIR_ESCAPED}/libhighlight-arm64.dylib + highlight_cli += ${BUILD_DIR_ESCAPED}/highlight-arm64 - wrapper_lib_shared += ${BUILD_DIR}/libwrapper_highlight-arm64.dylib - wrapper_lib_static += ${BUILD_DIR}/libwrapper_highlight-arm64.a + wrapper_lib_shared += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.dylib + wrapper_lib_static += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.a else # build intel code - lua_libraries += ${BUILD_DIR}/liblua-x86_64.a + lua_libraries += ${BUILD_DIR_ESCAPED}/liblua-x86_64.a - highlight_lib_static += ${BUILD_DIR}/libhighlight-x86_64.a - highlight_lib_shared += ${BUILD_DIR}/libhighlight-x86_64.dylib - highlight_cli += ${BUILD_DIR}/highlight-x86_64 + highlight_lib_static += ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.a + highlight_lib_shared += ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.dylib + highlight_cli += ${BUILD_DIR_ESCAPED}/highlight-x86_64 - wrapper_lib_shared += ${BUILD_DIR}/libwrapper_highlight-x86_64.dylib - wrapper_lib_static += ${BUILD_DIR}/libwrapper_highlight-x86_64.a + wrapper_lib_shared += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.dylib + wrapper_lib_static += ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.a endif endif @@ -112,53 +116,54 @@ ifeq ($(filter $(NATIVE_ARCH),$(VALID_ARCHS)),) $(error "Current arch ${NATIVE_ARCH} is not supported! Valid archs are: ${VALID_ARCHS}.") endif ifeq ($(ONLY_ACTIVE_ARCH),NO) - @echo "${bold}Building universal binary...${normal}" + @echo "\n${bold}** BUILDING UNIVERSAL BINARY... ** ${normal}" else - @echo "${bold}Building $(NATIVE_ARCH) architecture...${normal}" + @echo "\n${bold}** BUILDING $(NATIVE_ARCH) ARCHITECTURE... ** ${normal}" endif - @echo "Build dir: $(BUILD_DIR)" + @echo "Build dir: $(BUILD_DIR_ESCAPED)" @echo "" build_dir: $(shell mkdir build 2> /dev/null) + # ################################ # LUA library # ################################ -lua_arm: ${BUILD_DIR}/liblua-arm64.a -lua_intel: ${BUILD_DIR}/liblua-x86_64.a -lua: ${BUILD_DIR}/liblua.a +lua_arm: ${BUILD_DIR_ESCAPED}/liblua-arm64.a +lua_intel: ${BUILD_DIR_ESCAPED}/liblua-x86_64.a +lua: ${BUILD_DIR_ESCAPED}/liblua.a clean_lua: - @echo "${bold}Cleaning lua...${normal}" - ${MAKE} -C ${LUA_DIR} clean + @echo "\n${bold}🗑️ CLEANING lua...${normal}" + ${MAKE} -C "${LUA_DIR}" clean @echo "" -${BUILD_DIR}/liblua-arm64.a: | $(BUILD_DIR) - @echo "${bold}Building lua for arm64 platform…${normal}" +${BUILD_DIR_ESCAPED}/liblua-arm64.a: | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING lua FOR arm64 PLATFORM...${normal}" ${MAKE} -C "${LUA_DIR}" clean - ${MAKE} CC="gcc -std=gnu99 -target arm64-apple-macos11" MYCFLAGS="$(CFLAGS_arm64)" MYLDFLAGS="$(LDFLAGS_arm64)" -C "${LUA_DIR}" + ${MAKE} CC="gcc -std=gnu99 -target arm64-apple-macos12.0" MYCFLAGS="$(CFLAGS_arm64)" MYLDFLAGS="$(LDFLAGS_arm64)" -C "${LUA_DIR}" @mkdir -p "${BUILD_DIR}" - mv "${LUA_DIR}/src/liblua.a" "${BUILD_DIR}/liblua-arm64.a" + mv "${LUA_DIR}/src/liblua.a" "$@" @echo "" -${BUILD_DIR}/liblua-x86_64.a: | $(BUILD_DIR) - @echo "${bold}Building lua for x86_64 platform…${normal}" +${BUILD_DIR_ESCAPED}/liblua-x86_64.a: | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING lua FOR x86_64 PLATFORM...${normal}" ${MAKE} -C "${LUA_DIR}" clean ${MAKE} MYCFLAGS="$(CFLAGS_x86_64)" MYLDFLAGS="$(LDFLAGS_x86_64)" -C "${LUA_DIR}" @mkdir -p "${BUILD_DIR}" - mv "${LUA_DIR}/src/liblua.a" "${BUILD_DIR}/liblua-x86_64.a" + mv "${LUA_DIR}/src/liblua.a" "$@" @echo "" -${BUILD_DIR}/liblua.a: $(BUILD_DIR) ${lua_libraries} +${BUILD_DIR_ESCAPED}/liblua.a: $(BUILD_DIR_ESCAPED) ${lua_libraries} ifeq ($(ONLY_ACTIVE_ARCH),NO) - @echo "${bold}Creating lua universal library...${normal}" - lipo -create -output "${BUILD_DIR}/liblua.a" "${BUILD_DIR}/liblua-x86_64.a" "${BUILD_DIR}/liblua-arm64.a" + @echo "\n${bold}CREATING lua UNIVERSAL LIBRARY...${normal}" + lipo -create -output "$@" ${BUILD_DIR_ESCAPED}/liblua-x86_64.a ${BUILD_DIR_ESCAPED}/liblua-arm64.a else - @echo "${bold}Creating lua library for ${NATIVE_ARCH}...${normal}" - @rm -f "${BUILD_DIR}/liblua.a" > /dev/null - ln "${BUILD_DIR}/liblua-${NATIVE_ARCH}.a" "${BUILD_DIR}/liblua.a" + @echo "\n${bold}CREATING lua LIBRARY FOR ${NATIVE_ARCH} PLATFORM...${normal}" + @rm -f "$@" > /dev/null + ln "${BUILD_DIR}/liblua-${NATIVE_ARCH}.a" "$@" endif @echo "" @@ -168,110 +173,232 @@ endif # Highlight library # ################################ -highlight_static: ${BUILD_DIR}/libhighlight.a -highlight_shared: ${BUILD_DIR}/libhighlight.dylib -highlight_cli: ${BUILD_DIR}/highlight ${BUILD_DIR}/share +highlight_static: ${BUILD_DIR_ESCAPED}/libhighlight.a +highlight_shared: ${BUILD_DIR_ESCAPED}/libhighlight.dylib +highlight_cli: highlight_shared ${BUILD_DIR_ESCAPED}/highlight ${BUILD_DIR_ESCAPED}/share -${BUILD_DIR}/libhighlight-arm64.a: | $(BUILD_DIR) lua - @echo "${bold}Building static highlight lib for arm64 platform...${normal}" +${BUILD_DIR_ESCAPED}/libhighlight-arm64.a: lua | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING highlight STATIC LIB FOR arm64 PLATFORM...${normal}" @cp highlight_custom/makefile2.makefile highlight/makefile2.makefile @cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile - ${MAKE} BUILD_DIR=build_arm-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_arm64} -I$(CURRENT_DIR)/" MYLDFLAGS="$(LDFLAGS_arm64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile lib-static - cp "${HIGHLIGHT_DIR}/src/build_arm-$(CONFIGURATION)/libhighlight.a" "${BUILD_DIR}/libhighlight-arm64.a" + + @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \ + if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw arm64; then \ + echo "Clean…"; \ + ${MAKE} \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + clean; \ + fi; \ + fi + + ${MAKE} \ + BUILD_DIR=${BUILD_DIR_ESCAPED}/build_arm64-$(CONFIGURATION) \ + LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \ + LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \ + CFLAGS="${CFLAGS} ${CFLAGS_arm64}" \ + LDFLAGS="$(LDFLAGS) $(LDFLAGS_arm64) -Wl,-rpath,'@loader_path/'" \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + lib-static install-lib-static @rm highlight/makefile2.makefile @rm highlight/src/makefile2.makefile @echo "" -${BUILD_DIR}/libhighlight-arm64.dylib: | $(BUILD_DIR) lua - @echo "${bold}Building shared highlight lib for arm64 platform...${normal}" +${BUILD_DIR_ESCAPED}/libhighlight-arm64.dylib: lua | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING highlight SHARED LIB FOR arm64 PLATFORM...${normal}" @cp highlight_custom/makefile2.makefile highlight/makefile2.makefile @cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile - ${MAKE} BUILD_DIR=build_arm-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_arm64} -I\"$(CURRENT_DIR)/\"" MYLDFLAGS="$(LDFLAGS_arm64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile lib-shared - cp "${HIGHLIGHT_DIR}/src/build_arm-$(CONFIGURATION)/libhighlight.dylib" "${BUILD_DIR}/libhighlight-arm64.dylib" + + @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \ + if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw arm64; then \ + echo "Clean…"; \ + ${MAKE} \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + clean; \ + fi; \ + fi + + ${MAKE} \ + BUILD_DIR="$(BUILD_DIR)/build_arm64-$(CONFIGURATION)" \ + LUA_CFLAGS="-I$(CURRENT_DIR_ESCAPED)/$(LUA_DIR)/src" \ + LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \ + CFLAGS="${CFLAGS} ${CFLAGS_arm64}" \ + LDFLAGS="$(LDFLAGS) $(LDFLAGS_arm64) -Wl,-rpath,'@loader_path/'" \ + -C "${HIGHLIGHT_DIR}" \ + -f makefile2.makefile \ + lib-shared install-lib-shared @rm highlight/makefile2.makefile @rm highlight/src/makefile2.makefile @echo "" -${BUILD_DIR}/highlight-arm64: | $(BUILD_DIR) lua - @echo "${bold}Building highlight for arm64 platform...${normal}" +${BUILD_DIR_ESCAPED}/highlight-arm64: lua | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING highlight FOR arm64 PLATFORM...${normal}" @cp highlight_custom/makefile2.makefile highlight/makefile2.makefile @cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile - ${MAKE} BUILD_DIR=build_arm-$(CONFIGURATION) LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" LUA_LIBS="-L$(BUILD_DIR) -llua -lm" MYCFLAGS="${CFLAGS_arm64} -I$(CURRENT_DIR)/" MYLDFLAGS="$(LDFLAGS_arm64)" -C ${HIGHLIGHT_DIR} -f makefile2.makefile cli - cp "${HIGHLIGHT_DIR}/src/build_arm-$(CONFIGURATION)/highlight" "${BUILD_DIR}/highlight-arm64" + + @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \ + if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw arm64; then \ + echo "Clean…"; \ + ${MAKE} \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + clean; \ + fi; \ + fi + + ${MAKE} \ + BUILD_DIR=${BUILD_DIR_ESCAPED}/build_arm64-$(CONFIGURATION) \ + LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \ + LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \ + CFLAGS="${CFLAGS} ${CFLAGS_arm64}" \ + LDFLAGS="$(LDFLAGS) $(LDFLAGS_arm64) -Wl,-rpath,'@loader_path/'" \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + cli install @rm highlight/makefile2.makefile @rm highlight/src/makefile2.makefile @echo "" -${BUILD_DIR}/libhighlight-x86_64.a: | $(BUILD_DIR) lua - @echo "${bold}Building static highlight lib for x86_64 platform...${normal}" +${BUILD_DIR_ESCAPED}/libhighlight-x86_64.a: lua | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING highlight STATIC LIB FOR X86_64 PLATFORM...${normal}" @cp highlight_custom/makefile2.makefile highlight/makefile2.makefile @cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile - ${MAKE} BUILD_DIR=build_intel-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_x86_64} -I\"$(CURRENT_DIR)/\"" MYLDFLAGS="$(LDFLAGS_x86_64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile lib-static - cp "${HIGHLIGHT_DIR}/src/build_intel-$(CONFIGURATION)/libhighlight.a" "${BUILD_DIR}/libhighlight-x86_64.a" + + @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \ + if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw x86_64; then \ + echo "Clean…"; \ + ${MAKE} \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + clean; \ + fi; \ + fi + + ${MAKE} \ + BUILD_DIR=${BUILD_DIR_ESCAPED}/build_x86_64-$(CONFIGURATION) \ + LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \ + LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \ + CFLAGS="${CFLAGS} ${CFLAGS_x86_64}" \ + LDFLAGS="$(LDFLAGS) $(LDFLAGS_x86_64) -Wl,-rpath,'@loader_path/'" \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + lib-static install-lib-static + @rm highlight/makefile2.makefile @rm highlight/src/makefile2.makefile @echo "" -${BUILD_DIR}/libhighlight-x86_64.dylib: | $(BUILD_DIR) lua - @echo "${bold}Building shared highlight lib for x86_64 platform...${normal}" +${BUILD_DIR_ESCAPED}/libhighlight-x86_64.dylib: lua | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING highlight SHARED LIB FOR x86_64 PLATFORM...${normal}" @cp highlight_custom/makefile2.makefile highlight/makefile2.makefile @cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile - ${MAKE} BUILD_DIR=build_intel-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_x86_64} -I\"$(CURRENT_DIR)/\"" MYLDFLAGS="$(LDFLAGS_x86_64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile lib-shared - cp "${HIGHLIGHT_DIR}/src/build_intel-$(CONFIGURATION)/libhighlight.dylib" "${BUILD_DIR}/libhighlight-x86_64.dylib" + + @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \ + if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw x86_64; then \ + echo "Clean…"; \ + ${MAKE} \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + clean; \ + fi; \ + fi + + ${MAKE} \ + BUILD_DIR=${BUILD_DIR_ESCAPED}/build_x86_64-$(CONFIGURATION) \ + LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \ + LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \ + CFLAGS="${CFLAGS} ${CFLAGS_x86_64}" \ + LDFLAGS="$(LDFLAGS) $(LDFLAGS_x86_64) -Wl,-rpath,'@loader_path/'" \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + lib-shared install-lib-shared + @rm highlight/makefile2.makefile @rm highlight/src/makefile2.makefile @echo "" -${BUILD_DIR}/highlight-x86_64: | $(BUILD_DIR) lua - @echo "${bold}Building highlight for x86_64 platform...${normal}" +${BUILD_DIR_ESCAPED}/highlight-x86_64: lua | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING highlight FOR x86_64 PLATFORM...${normal}" @cp highlight_custom/makefile2.makefile highlight/makefile2.makefile @cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile - ${MAKE} BUILD_DIR=build_intel-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_x86_64} -I\"$(CURRENT_DIR)/\"" MYLDFLAGS="$(LDFLAGS_x86_64)" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile cli - ${MAKE} PREFIX=build-$(CONFIGURATION) BUILD_DIR=build_intel-$(CONFIGURATION) LUA_CFLAGS="-I\"$(CURRENT_DIR)/$(LUA_DIR)/src\"" LUA_LIBS="-L\"$(BUILD_DIR)\" -llua -lm" MYCFLAGS="${CFLAGS_x86_64} -I\"$(CURRENT_DIR)/\"" -C "${HIGHLIGHT_DIR}" -f makefile2.makefile install - cp "${HIGHLIGHT_DIR}/src/build_intel-$(CONFIGURATION)/highlight" "${BUILD_DIR}/highlight-x86_64" + + @if [ -f "${HIGHLIGHT_DIR}/src/htmlgenerator.o" ]; then \ + if ! lipo -archs "${HIGHLIGHT_DIR}/src/htmlgenerator.o" 2>/dev/null | grep -qw x86_64; then \ + echo "Clean…"; \ + ${MAKE} \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + clean; \ + fi; \ + fi + + ${MAKE} \ + BUILD_DIR=${BUILD_DIR_ESCAPED}/build_x86_64-$(CONFIGURATION) \ + LUA_CFLAGS="-I$(CURRENT_DIR)/$(LUA_DIR)/src" \ + LUA_LIBS="-L$(BUILD_DIR_ESCAPED) -llua -lm" \ + CFLAGS="${CFLAGS} ${CFLAGS_x86_64}" \ + LDFLAGS="$(LDFLAGS) $(LDFLAGS_x86_64) -Wl,-rpath,'@loader_path/'" \ + -C ${HIGHLIGHT_DIR} \ + -f makefile2.makefile \ + cli install + @rm highlight/makefile2.makefile @rm highlight/src/makefile2.makefile @echo "" -${BUILD_DIR}/libhighlight.a: $(BUILD_DIR) ${highlight_lib_static} | lua +${BUILD_DIR_ESCAPED}/libhighlight.a: ${highlight_lib_static} lua | $(BUILD_DIR_ESCAPED) ifeq ($(ONLY_ACTIVE_ARCH),NO) - @echo "${bold}Creating universal static highlight lib...${normal}" - lipo -create -output "${BUILD_DIR}/libhighlight.a" "${BUILD_DIR}/libhighlight-x86_64.a" "${BUILD_DIR}/libhighlight-arm64.a" + @echo "\n${bold}CREATING UNIVERSAL STATIC highlight LIB...${normal}" + lipo -create -output "$@" \ + "${BUILD_DIR}/build_x86_64-$(CONFIGURATION)/lib/libhighlight.a" \ + "${BUILD_DIR}/build_arm64-$(CONFIGURATION)/lib/libhighlight.a" else - @echo "${bold}Creating ${NATIVE_ARCH} static highlight lib...${normal}" - @rm -f "${BUILD_DIR}/libhighlight.a" > /dev/null - ln "${BUILD_DIR}/libhighlight-${NATIVE_ARCH}.a" "${BUILD_DIR}/libhighlight.a" + @echo "\n${bold}CREATING ${NATIVE_ARCH} STATIC highlight LIB...${normal}" + @rm -f "$@" > /dev/null + ln "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/lib/libhighlight.a" "$@" endif @echo "" -${BUILD_DIR}/libhighlight.dylib: $(BUILD_DIR) ${highlight_lib_shared} | lua +${BUILD_DIR_ESCAPED}/libhighlight.dylib: ${highlight_lib_shared} lua | $(BUILD_DIR_ESCAPED) ifeq ($(ONLY_ACTIVE_ARCH),NO) - @echo "${bold}Creating universal shared highlight lib...${normal}" - lipo -create -output "${BUILD_DIR}/libhighlight.dylib" "${BUILD_DIR}/libhighlight-x86_64.dylib" "${BUILD_DIR}/libhighlight-arm64.dylib" + @echo "\n${bold}CREATING UNIVERSAL SHARED highlight LIB...${normal}" + lipo -create -output "$@" \ + "${BUILD_DIR}/build_x86_64-$(CONFIGURATION)/lib/libhighlight.dylib" \ + "${BUILD_DIR}/build_arm64-$(CONFIGURATION)/lib/libhighlight.dylib" else - @echo "${bold}Creating ${NATIVE_ARCH} shared highlight lib...${normal}" - @rm -f "${BUILD_DIR}/libhighlight.dylib" > /dev/null - ln "${BUILD_DIR}/libhighlight-${NATIVE_ARCH}.dylib" "${BUILD_DIR}/libhighlight.dylib" + @echo "\n${bold}CREATING ${NATIVE_ARCH} SHARED highlight LIB...${normal}" + @rm -f "$@" > /dev/null + ln "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/lib/libhighlight.dylib" "$@" endif @echo "" -${BUILD_DIR}/highlight: $(BUILD_DIR) $(highlight_cli) | lua +${BUILD_DIR_ESCAPED}/highlight: $(highlight_cli) lua | $(BUILD_DIR_ESCAPED) ifeq ($(ONLY_ACTIVE_ARCH),NO) - @echo "${bold}Creating universal highlight...${normal}" - lipo -create -output "${BUILD_DIR}/highlight" "${BUILD_DIR}/highlight-x86_64" "${BUILD_DIR}/highlight-arm64" + @echo "\n${bold}CREATING UNIVERSAL highlight...${normal}" + lipo -create -output "$@" \ + "${BUILD_DIR}/build_x86_64-$(CONFIGURATION)/bin/highlight" \ + "${BUILD_DIR}/build_arm64-$(CONFIGURATION)/bin/highlight" else - @echo "${bold}Creating ${NATIVE_ARCH} highlight...${normal}" - @rm -f "${BUILD_DIR}/highlight" > /dev/null - ln "${BUILD_DIR}/highlight-${NATIVE_ARCH}" "${BUILD_DIR}/highlight" + @echo "\n${bold}CREATING ${NATIVE_ARCH} highlight...${normal}" + @rm -f "$@" > /dev/null + ln "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/bin/highlight" "$@" endif + @echo "🖋️ CODE SIGNING THE HIGHLIGHT APP" + /usr/bin/codesign --force --deep --sign "$(CODE_SIGN_IDENTITY)" \ + --options runtime \ + --entitlements $(CURRENT_DIR)/entitlements.entitlements \ + ${OTHER_CODE_SIGN_FLAGS} \ + "$@" @echo "" -${BUILD_DIR}/share: $(BUILD_DIR) ${BUILD_DIR}/highlight - cp -R "${HIGHLIGHT_DIR}/build-$(CONFIGURATION)/share/highlight/" "${BUILD_DIR}/share/" - cp "${HIGHLIGHT_DIR}/build-$(CONFIGURATION)/etc/highlight/filetypes.conf" "${BUILD_DIR}/share/filetypes.conf" +${BUILD_DIR_ESCAPED}/share: ${BUILD_DIR_ESCAPED}/highlight | $(BUILD_DIR_ESCAPED) + cp -R "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/share/highlight/" "${BUILD_DIR}/share/" + cp "${BUILD_DIR}/build_${NATIVE_ARCH}-$(CONFIGURATION)/etc/highlight/filetypes.conf" "${BUILD_DIR}/share/filetypes.conf" clean_highlight: - @echo "${bold}Cleaning highlight…${normal}" + @echo "\n${bold}🗑️ CLEANING highlight...${normal}" @cp highlight_custom/makefile2.makefile highlight/makefile2.makefile @cp highlight_custom/src/makefile2.makefile highlight/src/makefile2.makefile @${MAKE} -C "${HIGHLIGHT_DIR}" -f makefile2.makefile clean @@ -284,64 +411,64 @@ clean_highlight: # Highlight wrapper # ################################ -highlight-wrapper_intel: ${BUILD_DIR}/libwrapper_highlight-x86_64.dylib -highlight-wrapper_arm: ${BUILD_DIR}/libwrapper_highlight-arm64.dylib -highlight-wrapper: ${BUILD_DIR}/libwrapper_highlight.dylib +highlight-wrapper_intel: ${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.dylib +highlight-wrapper_arm: ${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.dylib +highlight-wrapper: ${BUILD_DIR_ESCAPED}/libwrapper_highlight.dylib clean_highlight-wrapper: - @echo "${bold}Cleaning highlight wrapper…${normal}" + @echo "\n${bold}🗑️ CLEANING highlight wrapper...${normal}" @rm -f "${BUILD_DIR}/wrapper_highlight-x86_64.o" @rm -f "${BUILD_DIR}/wrapper_highlight-arm64.o" @echo "" -${BUILD_DIR}/libwrapper_highlight-x86_64.dylib: $(BUILD_DIR) ${BUILD_DIR}/liblua.a ${BUILD_DIR}/libhighlight-x86_64.a wrapper_highlight.cpp - @echo "${bold}Compiling highlight wrapper for x86_64 platform...${normal}" +${BUILD_DIR_ESCAPED}/libwrapper_highlight-x86_64.dylib: ${BUILD_DIR_ESCAPED}/liblua.a ${BUILD_DIR_ESCAPED}/libhighlight-x86_64.a wrapper_highlight.cpp | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING highlight WRAPPER FOR x86_64 PLATFORM...${normal}" @echo "current dir: ${CURRENT_DIR}" - ${CXX} ${CFLAGS} ${CFLAGS_x86_64} ${LDFLAGS} ${LDFLAGS_x86_64} \ --static \ --c wrapper_highlight.cpp -o "${BUILD_DIR}/wrapper_highlight-x86_64.o" + ${CXX} ${CFLAGS} -Wall -O2 -std=c++17 -D_FILE_OFFSET_BITS=64 -MMD -MP ${CFLAGS_x86_64} ${LDFLAGS} ${LDFLAGS_x86_64} \ + -static \ + -c wrapper_highlight.cpp -o "${BUILD_DIR}/wrapper_highlight-x86_64.o" @echo "" - @echo "${bold}Creating highlight wrapper shared library for x86_64 platform...${normal}" + @echo "\n${bold}CREATING highlight wrapper SHARED LIBRARY FOR x86_64 PLATFORM...${normal}" ${CXX} ${CFLAGS} ${CFLAGS_x86_64} ${LDFLAGS} ${LDFLAGS_x86_64} \ --ldl -lhighlight -llua \ --dynamiclib \ --install_name @rpath/libwrapper_highlight.dylib \ --o "${BUILD_DIR}/libwrapper_highlight-x86_64.dylib" "${BUILD_DIR}/wrapper_highlight-x86_64.o" + -ldl -lhighlight -llua \ + -dynamiclib \ + -install_name @rpath/libwrapper_highlight.dylib \ + -o "$@" "${BUILD_DIR}/wrapper_highlight-x86_64.o" @echo "" -${BUILD_DIR}/libwrapper_highlight-arm64.dylib: $(BUILD_DIR) ${BUILD_DIR}/liblua.a ${BUILD_DIR}/libhighlight-arm64.a wrapper_highlight.cpp - @echo "${bold}Compiling highlight wrapper for arm64 platform...${normal}" - ${CXX} ${CFLAGS} ${CFLAGS_arm64} \ --static \ --c wrapper_highlight.cpp -o "${BUILD_DIR}/wrapper_highlight-arm64.o" +${BUILD_DIR_ESCAPED}/libwrapper_highlight-arm64.dylib: ${BUILD_DIR_ESCAPED}/liblua.a ${BUILD_DIR_ESCAPED}/libhighlight-arm64.a wrapper_highlight.cpp | $(BUILD_DIR_ESCAPED) + @echo "\n${bold}🔨 BUILDING highlight wrapper FOR arm64 PLATFORM...${normal}" + ${CXX} ${CFLAGS} -Wall -O2 -std=c++17 -D_FILE_OFFSET_BITS=64 -MMD -MP ${CFLAGS_arm64} \ + -static \ + -c wrapper_highlight.cpp -o "${BUILD_DIR}/wrapper_highlight-arm64.o" @echo "" - @echo "${bold}Creating highlight wrapper shared library for arm64 platform...${normal}" + @echo "\n${bold}CREATING highlight wrapper SHARED LIBRARY FOR arm64 PLATFORM...${normal}" ${CXX} ${CFLAGS} ${CFLAGS_arm64} ${LDFLAGS} ${LDFLAGS_arm64} \ --ldl -lhighlight -llua -framework CoreFoundation \ --dynamiclib \ --install_name @rpath/libwrapper_highlight.dylib \ --o "${BUILD_DIR}/libwrapper_highlight-arm64.dylib" "${BUILD_DIR}/wrapper_highlight-arm64.o" + -ldl -lhighlight -llua -framework CoreFoundation \ + -dynamiclib \ + -install_name @rpath/libwrapper_highlight.dylib \ + -o "$@" "${BUILD_DIR}/wrapper_highlight-arm64.o" @echo "" -${BUILD_DIR}/libwrapper_highlight.dylib: $(BUILD_DIR) ${wrapper_lib_shared} wrapper_highlight.cpp +${BUILD_DIR_ESCAPED}/libwrapper_highlight.dylib: ${wrapper_lib_shared} wrapper_highlight.cpp | $(BUILD_DIR_ESCAPED) ifeq ($(ONLY_ACTIVE_ARCH),NO) - @echo "${bold}Creating highlight wrapper universal shared library...${normal}" - lipo -create -output "${BUILD_DIR}/libwrapper_highlight.dylib" "${BUILD_DIR}/libwrapper_highlight-x86_64.dylib" "${BUILD_DIR}/libwrapper_highlight-arm64.dylib" + @echo "\n${bold}CREATING highlight wrapper UNIVERSAL SHARED LIBRARY...${normal}" + lipo -create -output "$@" "${BUILD_DIR}/libwrapper_highlight-x86_64.dylib" "${BUILD_DIR}/libwrapper_highlight-arm64.dylib" @echo "" else - @echo "${bold}Creating highlight wrapper library for ${NATIVE_ARCH}...${normal}" - cp "${BUILD_DIR}/libwrapper_highlight-${NATIVE_ARCH}.dylib" "${BUILD_DIR}/libwrapper_highlight.dylib" + @echo "\n${bold}CREATING highlight wrapper LIBRARY FOR ${NATIVE_ARCH} PLATFORM...${normal}" + cp "${BUILD_DIR}/libwrapper_highlight-${NATIVE_ARCH}.dylib" "$@" endif -$(BUILD_DIR): FORCE - @echo "Creating build dir $(BUILD_DIR)..." +$(BUILD_DIR_ESCAPED): FORCE + @echo "CREATING BUILD DIR $(BUILD_DIR_ESCAPED)..." mkdir -p "$(BUILD_DIR)" -all: $(BUILD_DIR) check_arch build_dir lua highlight_cli highlight_shared highlight-wrapper +all: check_arch build_dir lua highlight_cli highlight_shared highlight-wrapper | $(BUILD_DIR_ESCAPED) -install: $(BUILD_DIR) check_arch build_dir lua highlight_cli highlight_shared highlight-wrapper +install: check_arch build_dir lua highlight_cli highlight_shared highlight-wrapper | $(BUILD_DIR_ESCAPED) clean_intermediate: clean_lua clean_highlight clean_highlight-wrapper diff --git a/highlight-wrapper/boost/array.hpp b/highlight-wrapper/boost/array.hpp index f047063d..02bd76db 100644 --- a/highlight-wrapper/boost/array.hpp +++ b/highlight-wrapper/boost/array.hpp @@ -33,18 +33,18 @@ #include -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -# pragma warning(push) +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +# pragma warning(push) # pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe -# pragma warning(disable:4510) // boost::array' : default constructor could not be generated -# pragma warning(disable:4610) // warning C4610: class 'boost::array' can never be instantiated - user defined constructor required +# pragma warning(disable:4510) // boost::array' : default constructor could not be generated +# pragma warning(disable:4610) // warning C4610: class 'boost::array' can never be instantiated - user defined constructor required #endif #include #include #include #include -#include +#include #include #include @@ -75,7 +75,7 @@ namespace boost { iterator begin() { return elems; } const_iterator begin() const { return elems; } const_iterator cbegin() const { return elems; } - + iterator end() { return elems+N; } const_iterator end() const { return elems+N; } const_iterator cend() const { return elems+N; } @@ -84,9 +84,9 @@ namespace boost { #if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; -#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - typedef std::reverse_iterator reverse_iterator; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; #else @@ -112,39 +112,39 @@ namespace boost { } // operator[] - reference operator[](size_type i) - { - return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i]; + reference operator[](size_type i) + { + return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i]; } - - /*BOOST_CONSTEXPR*/ const_reference operator[](size_type i) const - { - return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i]; + + /*BOOST_CONSTEXPR*/ const_reference operator[](size_type i) const + { + return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i]; } // at() with range check reference at(size_type i) { return rangecheck(i), elems[i]; } /*BOOST_CONSTEXPR*/ const_reference at(size_type i) const { return rangecheck(i), elems[i]; } - + // front() and back() - reference front() - { - return elems[0]; + reference front() + { + return elems[0]; } - - BOOST_CONSTEXPR const_reference front() const + + BOOST_CONSTEXPR const_reference front() const { return elems[0]; } - - reference back() - { - return elems[N-1]; + + reference back() + { + return elems[N-1]; } - - BOOST_CONSTEXPR const_reference back() const - { - return elems[N-1]; + + BOOST_CONSTEXPR const_reference back() const + { + return elems[N-1]; } // size is constant @@ -156,7 +156,7 @@ namespace boost { // swap (note: linear complexity) void swap (array& y) { for (size_type i = 0; i < N; ++i) - boost::swap(elems[i],y.elems[i]); + boost::core::invoke_swap(elems[i],y.elems[i]); } // direct access to data (read-only) @@ -213,9 +213,9 @@ namespace boost { #if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; -#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - typedef std::reverse_iterator reverse_iterator; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; #else @@ -301,7 +301,7 @@ namespace boost { // assign one value to all elements void assign (const T& value) { fill ( value ); } void fill (const T& ) {} - + // check range (may be private because it is static) static reference failed_rangecheck () { std::out_of_range e("attempt to access element of an empty array"); @@ -353,16 +353,16 @@ namespace boost { #if defined(__SUNPRO_CC) // Trac ticket #4757; the Sun Solaris compiler can't handle // syntax like 'T(&get_c_array(boost::array& arg))[N]' -// -// We can't just use this for all compilers, because the -// borland compilers can't handle this form. +// +// We can't just use this for all compilers, because the +// borland compilers can't handle this form. namespace detail { template struct c_array { typedef T type[N]; }; } - + // Specific for boost::array: simply returns its elems data member. template typename detail::c_array::type& get_c_array(boost::array& arg) @@ -383,7 +383,7 @@ namespace boost { { return arg.elems; } - + // Const version. template const T(&get_c_array(const boost::array& arg))[N] @@ -391,7 +391,7 @@ namespace boost { return arg.elems; } #endif - + #if 0 // Overload for std::array, assuming that std::array will have // explicit conversion functions as discussed at the WG21 meeting @@ -401,7 +401,7 @@ namespace boost { { return static_cast(arg); } - + // Const version. template const T(&get_c_array(const std::array& arg))[N] @@ -423,7 +423,7 @@ namespace boost { BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(boost::array &) index out of range" ); return arr[Idx]; } - + template const T &get(const boost::array &arr) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(const boost::array &) index out of range" ); @@ -440,7 +440,7 @@ namespace std { BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(boost::array &) index out of range" ); return arr[Idx]; } - + template const T &get(const boost::array &arr) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(const boost::array &) index out of range" ); @@ -449,8 +449,8 @@ namespace std { } #endif -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -# pragma warning(pop) -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +# pragma warning(pop) +#endif #endif /*BOOST_ARRAY_HPP*/ diff --git a/highlight-wrapper/boost/assert/source_location.hpp b/highlight-wrapper/boost/assert/source_location.hpp index 09770f7d..c4d5f1b1 100644 --- a/highlight-wrapper/boost/assert/source_location.hpp +++ b/highlight-wrapper/boost/assert/source_location.hpp @@ -7,9 +7,7 @@ // Distributed under the Boost Software License, Version 1.0. // http://www.boost.org/LICENSE_1_0.txt -#include #include -#include #include #include #include @@ -146,6 +144,10 @@ template std::basic_ostream & operator<<( std::basic_ost # define BOOST_CURRENT_LOCATION ::boost::source_location() +#elif defined(BOOST_MSVC) && BOOST_MSVC >= 1935 + +# define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCSIG(), __builtin_COLUMN()) + #elif defined(BOOST_MSVC) && BOOST_MSVC >= 1926 // std::source_location::current() is available in -std:c++20, but fails with consteval errors before 19.31, and doesn't produce diff --git a/highlight-wrapper/boost/bind/apply.hpp b/highlight-wrapper/boost/bind/apply.hpp index 0520fd0a..a7eecace 100644 --- a/highlight-wrapper/boost/bind/apply.hpp +++ b/highlight-wrapper/boost/bind/apply.hpp @@ -2,18 +2,15 @@ #define BOOST_BIND_APPLY_HPP_INCLUDED // -// apply.hpp +// apply.hpp // -// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. +// Copyright 2002, 2003, 2024 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#include -#include - namespace boost { @@ -21,66 +18,10 @@ template struct apply { typedef R result_type; -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template result_type operator()( F&& f, A&&... a ) const { return static_cast( f )( static_cast( a )... ); } - -#else - - template result_type operator()(F & f) const - { - return f(); - } - - template result_type operator()(F & f, A1 & a1) const - { - return f(a1); - } - - template result_type operator()(F & f, A1 & a1, A2 & a2) const - { - return f(a1, a2); - } - - template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3) const - { - return f(a1, a2, a3); - } - - template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const - { - return f(a1, a2, a3, a4); - } - - template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const - { - return f(a1, a2, a3, a4, a5); - } - - template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const - { - return f(a1, a2, a3, a4, a5, a6); - } - - template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const - { - return f(a1, a2, a3, a4, a5, a6, a7); - } - - template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const - { - return f(a1, a2, a3, a4, a5, a6, a7, a8); - } - - template result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const - { - return f(a1, a2, a3, a4, a5, a6, a7, a8, a9); - } - -#endif }; } // namespace boost diff --git a/highlight-wrapper/boost/bind/bind.hpp b/highlight-wrapper/boost/bind/bind.hpp index fd0ee144..5ec79230 100644 --- a/highlight-wrapper/boost/bind/bind.hpp +++ b/highlight-wrapper/boost/bind/bind.hpp @@ -8,46 +8,33 @@ #endif // -// bind.hpp - binds function objects to arguments +// bind.hpp - binds function objects to arguments // -// Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd. -// Copyright (c) 2001 David Abrahams -// Copyright (c) 2005 Peter Dimov +// Copyright 2001-2005, 2024 Peter Dimov +// Copyright 2001 David Abrahams // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -// See http://www.boost.org/libs/bind/bind.html for documentation. +// See http://www.boost.org/libs/bind for documentation. // -#include -#include #include -#include -#include #include -#include #include -#include +#include +#include +#include #include +#include +#include #include -#include -#include - -#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) -#include // std::forward -#endif - -// Borland-specific bug, visit_each() silently fails to produce code - -#if defined(BOOST_BORLANDC) -# define BOOST_BIND_VISIT_EACH boost::visit_each -#else -# define BOOST_BIND_VISIT_EACH visit_each -#endif - -#include +#include +#include +#include +#include +#include #ifdef BOOST_MSVC # pragma warning(push) @@ -64,22 +51,22 @@ namespace _bi // implementation details // ref_compare -template bool ref_compare( T const & a, T const & b, long ) +template bool ref_compare( T const & a, T const & b ) { return a == b; } -template bool ref_compare( arg const &, arg const &, int ) +template bool ref_compare( arg const &, arg const & ) { return true; } -template bool ref_compare( arg (*) (), arg (*) (), int ) +template bool ref_compare( arg (*) (), arg (*) () ) { return true; } -template bool ref_compare( reference_wrapper const & a, reference_wrapper const & b, int ) +template bool ref_compare( reference_wrapper const & a, reference_wrapper const & b ) { return a.get_pointer() == b.get_pointer(); } @@ -88,7 +75,7 @@ template bool ref_compare( reference_wrapper const & a, reference_wr template class bind_t; -template bool ref_compare( bind_t const & a, bind_t const & b, int ) +template bool ref_compare( bind_t const & a, bind_t const & b ) { return a.compare( b ); } @@ -116,7 +103,7 @@ template class value // ref_compare for weak_ptr -template bool ref_compare( value< weak_ptr > const & a, value< weak_ptr > const & b, int ) +template bool ref_compare( value< weak_ptr > const & a, value< weak_ptr > const & b ) { return !(a.get() < b.get()) && !(b.get() < a.get()); } @@ -145,1409 +132,235 @@ template struct unwrapper } }; -// listN +// list -class list0 +template struct accept_lambda { -public: - - list0() {} - - template T & operator[] (_bi::value & v) const { return v.get(); } - - template T const & operator[] (_bi::value const & v) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } - - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - - template R operator()(type, F & f, A &, long) - { - return unwrapper::unwrap(f, 0)(); - } - - template R operator()(type, F const & f, A &, long) const - { - return unwrapper::unwrap(f, 0)(); - } - - template void operator()(type, F & f, A &, int) - { - unwrapper::unwrap(f, 0)(); - } - - template void operator()(type, F const & f, A &, int) const - { - unwrapper::unwrap(f, 0)(); - } + V& v_; - template void accept(V &) const - { - } + explicit accept_lambda( V& v ): v_( v ) {} - bool operator==(list0 const &) const + template void operator()( A& a ) const { - return true; + visit_each( v_, a, 0 ); } }; -#ifdef BOOST_MSVC -// MSVC is bright enough to realise that the parameter rhs -// in operator==may be unused for some template argument types: -#pragma warning(push) -#pragma warning(disable:4100) -#endif - -template< class A1 > class list1: private storage1< A1 > +struct equal_lambda { -private: - - typedef storage1< A1 > base_type; - -public: - - explicit list1( A1 a1 ): base_type( a1 ) {} - - A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - - A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } - - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - - template R operator()(type, F & f, A & a, long) - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_]); - } - - template R operator()(type, F const & f, A & a, long) const - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_]); - } - - template void operator()(type, F & f, A & a, int) - { - unwrapper::unwrap(f, 0)(a[base_type::a1_]); - } + bool result; - template void operator()(type, F const & f, A & a, int) const - { - unwrapper::unwrap(f, 0)(a[base_type::a1_]); - } - - template void accept(V & v) const - { - base_type::accept(v); - } + equal_lambda(): result( true ) {} - bool operator==(list1 const & rhs) const + template void operator()( A1& a1, A2& a2 ) { - return ref_compare(base_type::a1_, rhs.a1_, 0); + result = result && ref_compare( a1, a2 ); } }; struct logical_and; struct logical_or; -template< class A1, class A2 > class list2: private storage2< A1, A2 > -{ -private: - - typedef storage2< A1, A2 > base_type; - -public: - - list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {} - - A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - A2 operator[] (boost::arg<2>) const { return base_type::a2_; } - - A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } - - template T & operator[] (_bi::value & v) const { return v.get(); } - - template T const & operator[] (_bi::value const & v) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } - - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - - template R operator()(type, F & f, A & a, long) - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); - } - - template R operator()(type, F const & f, A & a, long) const - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); - } - - template void operator()(type, F & f, A & a, int) - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); - } - - template void operator()(type, F const & f, A & a, int) const - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); - } - - template bool operator()( type, logical_and & /*f*/, A & a, int ) - { - return a[ base_type::a1_ ] && a[ base_type::a2_ ]; - } - - template bool operator()( type, logical_and const & /*f*/, A & a, int ) const - { - return a[ base_type::a1_ ] && a[ base_type::a2_ ]; - } - - template bool operator()( type, logical_or & /*f*/, A & a, int ) - { - return a[ base_type::a1_ ] || a[ base_type::a2_ ]; - } - - template bool operator()( type, logical_or const & /*f*/, A & a, int ) const - { - return a[ base_type::a1_ ] || a[ base_type::a2_ ]; - } - - template void accept(V & v) const - { - base_type::accept(v); - } - - bool operator==(list2 const & rhs) const - { - return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0); - } -}; - -template< class A1, class A2, class A3 > class list3: private storage3< A1, A2, A3 > -{ -private: - - typedef storage3< A1, A2, A3 > base_type; - -public: - - list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {} - - A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - A2 operator[] (boost::arg<2>) const { return base_type::a2_; } - A3 operator[] (boost::arg<3>) const { return base_type::a3_; } - - A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } - - template T & operator[] (_bi::value & v) const { return v.get(); } - - template T const & operator[] (_bi::value const & v) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } - - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - - template R operator()(type, F & f, A & a, long) - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]); - } - - template R operator()(type, F const & f, A & a, long) const - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]); - } - - template void operator()(type, F & f, A & a, int) - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]); - } - - template void operator()(type, F const & f, A & a, int) const - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]); - } - - template void accept(V & v) const - { - base_type::accept(v); - } - - bool operator==(list3 const & rhs) const - { - return - - ref_compare( base_type::a1_, rhs.a1_, 0 ) && - ref_compare( base_type::a2_, rhs.a2_, 0 ) && - ref_compare( base_type::a3_, rhs.a3_, 0 ); - } -}; - -template< class A1, class A2, class A3, class A4 > class list4: private storage4< A1, A2, A3, A4 > -{ -private: - - typedef storage4< A1, A2, A3, A4 > base_type; - -public: - - list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {} - - A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - A2 operator[] (boost::arg<2>) const { return base_type::a2_; } - A3 operator[] (boost::arg<3>) const { return base_type::a3_; } - A4 operator[] (boost::arg<4>) const { return base_type::a4_; } - - A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } - - template T & operator[] (_bi::value & v) const { return v.get(); } - - template T const & operator[] (_bi::value const & v) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } - - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - - template R operator()(type, F & f, A & a, long) - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]); - } - - template R operator()(type, F const & f, A & a, long) const - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]); - } - - template void operator()(type, F & f, A & a, int) - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]); - } - - template void operator()(type, F const & f, A & a, int) const - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]); - } - - template void accept(V & v) const - { - base_type::accept(v); - } - - bool operator==(list4 const & rhs) const - { - return - - ref_compare( base_type::a1_, rhs.a1_, 0 ) && - ref_compare( base_type::a2_, rhs.a2_, 0 ) && - ref_compare( base_type::a3_, rhs.a3_, 0 ) && - ref_compare( base_type::a4_, rhs.a4_, 0 ); - } -}; - -template< class A1, class A2, class A3, class A4, class A5 > class list5: private storage5< A1, A2, A3, A4, A5 > -{ -private: - - typedef storage5< A1, A2, A3, A4, A5 > base_type; - -public: - - list5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): base_type( a1, a2, a3, a4, a5 ) {} - - A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - A2 operator[] (boost::arg<2>) const { return base_type::a2_; } - A3 operator[] (boost::arg<3>) const { return base_type::a3_; } - A4 operator[] (boost::arg<4>) const { return base_type::a4_; } - A5 operator[] (boost::arg<5>) const { return base_type::a5_; } - - A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; } - - template T & operator[] (_bi::value & v) const { return v.get(); } - - template T const & operator[] (_bi::value const & v) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } - - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - - template R operator()(type, F & f, A & a, long) - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]); - } - - template R operator()(type, F const & f, A & a, long) const - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]); - } - - template void operator()(type, F & f, A & a, int) - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]); - } - - template void operator()(type, F const & f, A & a, int) const - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]); - } - - template void accept(V & v) const - { - base_type::accept(v); - } - - bool operator==(list5 const & rhs) const - { - return - - ref_compare( base_type::a1_, rhs.a1_, 0 ) && - ref_compare( base_type::a2_, rhs.a2_, 0 ) && - ref_compare( base_type::a3_, rhs.a3_, 0 ) && - ref_compare( base_type::a4_, rhs.a4_, 0 ) && - ref_compare( base_type::a5_, rhs.a5_, 0 ); - } -}; - -template class list6: private storage6< A1, A2, A3, A4, A5, A6 > +template class list { private: - typedef storage6< A1, A2, A3, A4, A5, A6 > base_type; + typedef std::tuple data_type; + data_type data_; public: - list6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): base_type( a1, a2, a3, a4, a5, a6 ) {} - - A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - A2 operator[] (boost::arg<2>) const { return base_type::a2_; } - A3 operator[] (boost::arg<3>) const { return base_type::a3_; } - A4 operator[] (boost::arg<4>) const { return base_type::a4_; } - A5 operator[] (boost::arg<5>) const { return base_type::a5_; } - A6 operator[] (boost::arg<6>) const { return base_type::a6_; } - - A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; } - A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; } - - template T & operator[] (_bi::value & v) const { return v.get(); } - - template T const & operator[] (_bi::value const & v) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } - - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - - template R operator()(type, F & f, A & a, long) - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]); - } + list( A... a ): data_( a... ) {} - template R operator()(type, F const & f, A & a, long) const - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]); - } +#if defined(BOOST_MSVC) +# pragma warning( push ) +# pragma warning( disable: 4100 ) // unreferenced formal parameter 'a2' +#endif - template void operator()(type, F & f, A & a, int) + template R call_impl( type, F & f, A2 & a2, _bi::index_sequence ) { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]); + return unwrapper::unwrap( f, 0 )( a2[ std::get( data_ ) ]... ); } - template void operator()(type, F const & f, A & a, int) const + template R call_impl( type, F & f, A2 & a2, _bi::index_sequence ) const { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]); + return unwrapper::unwrap( f, 0 )( a2[ std::get( data_ ) ]... ); } - template void accept(V & v) const + template void call_impl( type, F & f, A2 & a2, _bi::index_sequence ) { - base_type::accept(v); + unwrapper::unwrap( f, 0 )( a2[ std::get( data_ ) ]... ); } - bool operator==(list6 const & rhs) const + template void call_impl( type, F & f, A2 & a2, _bi::index_sequence ) const { - return - - ref_compare( base_type::a1_, rhs.a1_, 0 ) && - ref_compare( base_type::a2_, rhs.a2_, 0 ) && - ref_compare( base_type::a3_, rhs.a3_, 0 ) && - ref_compare( base_type::a4_, rhs.a4_, 0 ) && - ref_compare( base_type::a5_, rhs.a5_, 0 ) && - ref_compare( base_type::a6_, rhs.a6_, 0 ); + unwrapper::unwrap( f, 0 )( a2[ std::get( data_ ) ]... ); } -}; - -template class list7: private storage7< A1, A2, A3, A4, A5, A6, A7 > -{ -private: - - typedef storage7< A1, A2, A3, A4, A5, A6, A7 > base_type; - -public: - - list7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): base_type( a1, a2, a3, a4, a5, a6, a7 ) {} - - A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - A2 operator[] (boost::arg<2>) const { return base_type::a2_; } - A3 operator[] (boost::arg<3>) const { return base_type::a3_; } - A4 operator[] (boost::arg<4>) const { return base_type::a4_; } - A5 operator[] (boost::arg<5>) const { return base_type::a5_; } - A6 operator[] (boost::arg<6>) const { return base_type::a6_; } - A7 operator[] (boost::arg<7>) const { return base_type::a7_; } - - A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; } - A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; } - A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; } - - template T & operator[] (_bi::value & v) const { return v.get(); } - - template T const & operator[] (_bi::value const & v) const { return v.get(); } - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } +#if defined(BOOST_MSVC) +# pragma warning( pop ) +#endif - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } + // - template R operator()(type, F & f, A & a, long) + template R operator()( type, F & f, A2 & a2 ) { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]); + return call_impl( type(), f, a2, _bi::index_sequence_for() ); } - template R operator()(type, F const & f, A & a, long) const + template R operator()( type, F & f, A2 & a2 ) const { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]); + return call_impl( type(), f, a2, _bi::index_sequence_for() ); } - template void operator()(type, F & f, A & a, int) - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]); - } + // - template void operator()(type, F const & f, A & a, int) const + template bool operator()( type, logical_and & /*f*/, A2 & a2 ) { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]); + static_assert( sizeof...(A) == 2, "operator&& must have two arguments" ); + return a2[ std::get<0>( data_ ) ] && a2[ std::get<1>( data_ ) ]; } - template void accept(V & v) const + template bool operator()( type, logical_and const & /*f*/, A2 & a2 ) const { - base_type::accept(v); + static_assert( sizeof...(A) == 2, "operator&& must have two arguments" ); + return a2[ std::get<0>( data_ ) ] && a2[ std::get<1>( data_ ) ]; } - bool operator==(list7 const & rhs) const + template bool operator()( type, logical_or & /*f*/, A2 & a2 ) { - return - - ref_compare( base_type::a1_, rhs.a1_, 0 ) && - ref_compare( base_type::a2_, rhs.a2_, 0 ) && - ref_compare( base_type::a3_, rhs.a3_, 0 ) && - ref_compare( base_type::a4_, rhs.a4_, 0 ) && - ref_compare( base_type::a5_, rhs.a5_, 0 ) && - ref_compare( base_type::a6_, rhs.a6_, 0 ) && - ref_compare( base_type::a7_, rhs.a7_, 0 ); + static_assert( sizeof...(A) == 2, "operator|| must have two arguments" ); + return a2[ std::get<0>( data_ ) ] || a2[ std::get<1>( data_ ) ]; } -}; - -template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class list8: private storage8< A1, A2, A3, A4, A5, A6, A7, A8 > -{ -private: - - typedef storage8< A1, A2, A3, A4, A5, A6, A7, A8 > base_type; - -public: - - list8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8 ) {} - - A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - A2 operator[] (boost::arg<2>) const { return base_type::a2_; } - A3 operator[] (boost::arg<3>) const { return base_type::a3_; } - A4 operator[] (boost::arg<4>) const { return base_type::a4_; } - A5 operator[] (boost::arg<5>) const { return base_type::a5_; } - A6 operator[] (boost::arg<6>) const { return base_type::a6_; } - A7 operator[] (boost::arg<7>) const { return base_type::a7_; } - A8 operator[] (boost::arg<8>) const { return base_type::a8_; } - - A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; } - A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; } - A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; } - A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; } - - template T & operator[] (_bi::value & v) const { return v.get(); } - - template T const & operator[] (_bi::value const & v) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } - - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - - template R operator()(type, F & f, A & a, long) - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]); - } - - template R operator()(type, F const & f, A & a, long) const - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]); - } - - template void operator()(type, F & f, A & a, int) - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]); - } - - template void operator()(type, F const & f, A & a, int) const - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]); - } - - template void accept(V & v) const - { - base_type::accept(v); - } - - bool operator==(list8 const & rhs) const - { - return - - ref_compare( base_type::a1_, rhs.a1_, 0 ) && - ref_compare( base_type::a2_, rhs.a2_, 0 ) && - ref_compare( base_type::a3_, rhs.a3_, 0 ) && - ref_compare( base_type::a4_, rhs.a4_, 0 ) && - ref_compare( base_type::a5_, rhs.a5_, 0 ) && - ref_compare( base_type::a6_, rhs.a6_, 0 ) && - ref_compare( base_type::a7_, rhs.a7_, 0 ) && - ref_compare( base_type::a8_, rhs.a8_, 0 ); - } -}; - -template class list9: private storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > -{ -private: - - typedef storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > base_type; - -public: - - list9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8, a9 ) {} - - A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - A2 operator[] (boost::arg<2>) const { return base_type::a2_; } - A3 operator[] (boost::arg<3>) const { return base_type::a3_; } - A4 operator[] (boost::arg<4>) const { return base_type::a4_; } - A5 operator[] (boost::arg<5>) const { return base_type::a5_; } - A6 operator[] (boost::arg<6>) const { return base_type::a6_; } - A7 operator[] (boost::arg<7>) const { return base_type::a7_; } - A8 operator[] (boost::arg<8>) const { return base_type::a8_; } - A9 operator[] (boost::arg<9>) const { return base_type::a9_; } - - A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; } - A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; } - A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; } - A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; } - A9 operator[] (boost::arg<9> (*) ()) const { return base_type::a9_; } - - template T & operator[] (_bi::value & v) const { return v.get(); } - - template T const & operator[] (_bi::value const & v) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const { return b.eval(*this); } - - template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - - template R operator()(type, F & f, A & a, long) - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]); - } - - template R operator()(type, F const & f, A & a, long) const - { - return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]); - } - - template void operator()(type, F & f, A & a, int) - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]); - } - - template void operator()(type, F const & f, A & a, int) const - { - unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]); - } - - template void accept(V & v) const - { - base_type::accept(v); - } - - bool operator==(list9 const & rhs) const - { - return - - ref_compare( base_type::a1_, rhs.a1_, 0 ) && - ref_compare( base_type::a2_, rhs.a2_, 0 ) && - ref_compare( base_type::a3_, rhs.a3_, 0 ) && - ref_compare( base_type::a4_, rhs.a4_, 0 ) && - ref_compare( base_type::a5_, rhs.a5_, 0 ) && - ref_compare( base_type::a6_, rhs.a6_, 0 ) && - ref_compare( base_type::a7_, rhs.a7_, 0 ) && - ref_compare( base_type::a8_, rhs.a8_, 0 ) && - ref_compare( base_type::a9_, rhs.a9_, 0 ); - } -}; - -#ifdef BOOST_MSVC -#pragma warning(pop) -#endif - -// bind_t - -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !(defined(BOOST_GCC) && BOOST_GCC < 40600) - -template< class A1 > class rrlist1 -{ -private: - - A1 & a1_; // not A1&& because of msvc-10.0 - -public: - - explicit rrlist1( A1 & a1 ): a1_( a1 ) {} - - A1 && operator[] (boost::arg<1>) const { return std::forward( a1_ ); } // not static_cast because of g++ 4.9 - - A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward( a1_ ); } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const - { - rrlist1 a( a1_ ); - return b.eval( a ); - } - - template typename result_traits::type operator[] (bind_t const & b) const - { - rrlist1 a( a1_ ); - return b.eval( a ); - } -}; - -template< class A1, class A2 > class rrlist2 -{ -private: - - A1 & a1_; - A2 & a2_; - -public: - - rrlist2( A1 & a1, A2 & a2 ): a1_( a1 ), a2_( a2 ) {} - - A1 && operator[] (boost::arg<1>) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2>) const { return std::forward( a2_ ); } - - A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward( a2_ ); } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const - { - rrlist2 a( a1_, a2_ ); - return b.eval( a ); - } - - template typename result_traits::type operator[] (bind_t const & b) const - { - rrlist2 a( a1_, a2_ ); - return b.eval( a ); - } -}; - -template< class A1, class A2, class A3 > class rrlist3 -{ -private: - - A1 & a1_; - A2 & a2_; - A3 & a3_; - -public: - - rrlist3( A1 & a1, A2 & a2, A3 & a3 ): a1_( a1 ), a2_( a2 ), a3_( a3 ) {} - - A1 && operator[] (boost::arg<1>) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2>) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3>) const { return std::forward( a3_ ); } - - A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward( a3_ ); } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const - { - rrlist3 a( a1_, a2_, a3_ ); - return b.eval( a ); - } - - template typename result_traits::type operator[] (bind_t const & b) const - { - rrlist3 a( a1_, a2_, a3_ ); - return b.eval( a ); - } -}; - -template< class A1, class A2, class A3, class A4 > class rrlist4 -{ -private: - - A1 & a1_; - A2 & a2_; - A3 & a3_; - A4 & a4_; - -public: - - rrlist4( A1 & a1, A2 & a2, A3 & a3, A4 & a4 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ) {} - - A1 && operator[] (boost::arg<1>) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2>) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3>) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4>) const { return std::forward( a4_ ); } - - A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward( a4_ ); } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const - { - rrlist4 a( a1_, a2_, a3_, a4_ ); - return b.eval( a ); - } - - template typename result_traits::type operator[] (bind_t const & b) const - { - rrlist4 a( a1_, a2_, a3_, a4_ ); - return b.eval( a ); - } -}; - -template< class A1, class A2, class A3, class A4, class A5 > class rrlist5 -{ -private: - - A1 & a1_; - A2 & a2_; - A3 & a3_; - A4 & a4_; - A5 & a5_; - -public: - - rrlist5( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ) {} - - A1 && operator[] (boost::arg<1>) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2>) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3>) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4>) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5>) const { return std::forward( a5_ ); } - - A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward( a5_ ); } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const - { - rrlist5 a( a1_, a2_, a3_, a4_, a5_ ); - return b.eval( a ); - } - - template typename result_traits::type operator[] (bind_t const & b) const - { - rrlist5 a( a1_, a2_, a3_, a4_, a5_ ); - return b.eval( a ); - } -}; - -template< class A1, class A2, class A3, class A4, class A5, class A6 > class rrlist6 -{ -private: - - A1 & a1_; - A2 & a2_; - A3 & a3_; - A4 & a4_; - A5 & a5_; - A6 & a6_; - -public: - - rrlist6( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ) {} - - A1 && operator[] (boost::arg<1>) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2>) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3>) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4>) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5>) const { return std::forward( a5_ ); } - A6 && operator[] (boost::arg<6>) const { return std::forward( a6_ ); } - - A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward( a5_ ); } - A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward( a6_ ); } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const - { - rrlist6 a( a1_, a2_, a3_, a4_, a5_, a6_ ); - return b.eval( a ); - } - - template typename result_traits::type operator[] (bind_t const & b) const - { - rrlist6 a( a1_, a2_, a3_, a4_, a5_, a6_ ); - return b.eval( a ); - } -}; - -template< class A1, class A2, class A3, class A4, class A5, class A6, class A7 > class rrlist7 -{ -private: - - A1 & a1_; - A2 & a2_; - A3 & a3_; - A4 & a4_; - A5 & a5_; - A6 & a6_; - A7 & a7_; - -public: - - rrlist7( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ) {} - - A1 && operator[] (boost::arg<1>) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2>) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3>) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4>) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5>) const { return std::forward( a5_ ); } - A6 && operator[] (boost::arg<6>) const { return std::forward( a6_ ); } - A7 && operator[] (boost::arg<7>) const { return std::forward( a7_ ); } - - A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward( a5_ ); } - A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward( a6_ ); } - A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward( a7_ ); } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const - { - rrlist7 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ ); - return b.eval( a ); - } - - template typename result_traits::type operator[] (bind_t const & b) const - { - rrlist7 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ ); - return b.eval( a ); - } -}; - -template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class rrlist8 -{ -private: - - A1 & a1_; - A2 & a2_; - A3 & a3_; - A4 & a4_; - A5 & a5_; - A6 & a6_; - A7 & a7_; - A8 & a8_; - -public: - - rrlist8( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ), a8_( a8 ) {} - - A1 && operator[] (boost::arg<1>) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2>) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3>) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4>) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5>) const { return std::forward( a5_ ); } - A6 && operator[] (boost::arg<6>) const { return std::forward( a6_ ); } - A7 && operator[] (boost::arg<7>) const { return std::forward( a7_ ); } - A8 && operator[] (boost::arg<8>) const { return std::forward( a8_ ); } - - A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward( a5_ ); } - A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward( a6_ ); } - A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward( a7_ ); } - A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward( a8_ ); } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const - { - rrlist8 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ ); - return b.eval( a ); - } - - template typename result_traits::type operator[] (bind_t const & b) const - { - rrlist8 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ ); - return b.eval( a ); - } -}; - -template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > class rrlist9 -{ -private: - - A1 & a1_; - A2 & a2_; - A3 & a3_; - A4 & a4_; - A5 & a5_; - A6 & a6_; - A7 & a7_; - A8 & a8_; - A9 & a9_; - -public: - - rrlist9( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ), a8_( a8 ), a9_( a9 ) {} - - A1 && operator[] (boost::arg<1>) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2>) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3>) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4>) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5>) const { return std::forward( a5_ ); } - A6 && operator[] (boost::arg<6>) const { return std::forward( a6_ ); } - A7 && operator[] (boost::arg<7>) const { return std::forward( a7_ ); } - A8 && operator[] (boost::arg<8>) const { return std::forward( a8_ ); } - A9 && operator[] (boost::arg<9>) const { return std::forward( a9_ ); } - - A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward( a1_ ); } - A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward( a2_ ); } - A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward( a3_ ); } - A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward( a4_ ); } - A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward( a5_ ); } - A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward( a6_ ); } - A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward( a7_ ); } - A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward( a8_ ); } - A9 && operator[] (boost::arg<9> (*) ()) const { return std::forward( a9_ ); } - - template T & operator[] ( _bi::value & v ) const { return v.get(); } - - template T const & operator[] ( _bi::value const & v ) const { return v.get(); } - - template T & operator[] (reference_wrapper const & v) const { return v.get(); } - - template typename result_traits::type operator[] (bind_t & b) const - { - rrlist9 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ ); - return b.eval( a ); - } - - template typename result_traits::type operator[] (bind_t const & b) const - { - rrlist9 a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ ); - return b.eval( a ); - } -}; - -template class bind_t -{ -private: - - F f_; - L l_; - -public: - - typedef typename result_traits::type result_type; - typedef bind_t this_type; - - bind_t( F f, L const & l ): f_( f ), l_( l ) {} - - // - - result_type operator()() - { - list0 a; - return l_( type(), f_, a, 0 ); - } - - result_type operator()() const - { - list0 a; - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1 ) - { - rrlist1< A1 > a( a1 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1 ) const - { - rrlist1< A1 > a( a1 ); - return l_(type(), f_, a, 0); - } - - template result_type operator()( A1 && a1, A2 && a2 ) - { - rrlist2< A1, A2 > a( a1, a2 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2 ) const - { - rrlist2< A1, A2 > a( a1, a2 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3 ) - { - rrlist3< A1, A2, A3 > a( a1, a2, a3 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3 ) const - { - rrlist3< A1, A2, A3 > a( a1, a2, a3 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 ) - { - rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 ) const - { - rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 ) - { - rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 ) const - { - rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 ) - { - rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 ) const - { - rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 ) - { - rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 ) const - { - rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 ) - { - rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 ) const - { - rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 ) - { - rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 ); - return l_( type(), f_, a, 0 ); - } - - template result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 ) const - { - rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 ); - return l_( type(), f_, a, 0 ); - } - - // - - template result_type eval( A & a ) - { - return l_( type(), f_, a, 0 ); - } - - template result_type eval( A & a ) const - { - return l_( type(), f_, a, 0 ); - } - - template void accept( V & v ) const - { -#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( BOOST_BORLANDC ) - using boost::visit_each; -#endif - - BOOST_BIND_VISIT_EACH( v, f_, 0 ); - l_.accept( v ); - } - - bool compare( this_type const & rhs ) const - { - return ref_compare( f_, rhs.f_, 0 ) && l_ == rhs.l_; - } -}; - -#elif !defined( BOOST_NO_VOID_RETURNS ) - -template class bind_t -{ -public: - - typedef bind_t this_type; - - bind_t(F f, L const & l): f_(f), l_(l) {} - -#define BOOST_BIND_RETURN return -#include -#undef BOOST_BIND_RETURN - -}; - -#else // no void returns - -template struct bind_t_generator -{ - -template class implementation -{ -public: - - typedef implementation this_type; - implementation(F f, L const & l): f_(f), l_(l) {} + template bool operator()( type, logical_or const & /*f*/, A2 & a2 ) const + { + static_assert( sizeof...(A) == 2, "operator|| must have two arguments" ); + return a2[ std::get<0>( data_ ) ] || a2[ std::get<1>( data_ ) ]; + } -#define BOOST_BIND_RETURN return -#include -#undef BOOST_BIND_RETURN + // -}; + template void accept( V & v ) const + { + _bi::tuple_for_each( accept_lambda( v ), data_ ); + } + bool operator==( list const & rhs ) const + { + return _bi::tuple_for_each( equal_lambda(), data_, rhs.data_ ).result; + } }; -template<> struct bind_t_generator -{ +// bind_t -template class implementation +template class rrlist { private: - typedef void R; + using args_type = std::tuple; + + using data_type = std::tuple; + data_type data_; + + template friend class rrlist; public: - typedef implementation this_type; + explicit rrlist( A&... a ): data_( a... ) {} + template explicit rrlist( rrlist const& r ): data_( r.data_ ) {} - implementation(F f, L const & l): f_(f), l_(l) {} + template typename std::tuple_element::type&& operator[] ( boost::arg ) const + { + return std::forward::type>( std::get( data_ ) ); + } -#define BOOST_BIND_RETURN -#include -#undef BOOST_BIND_RETURN + template typename std::tuple_element::type&& operator[] ( boost::arg(*)() ) const + { + return std::forward::type>( std::get( data_ ) ); + } -}; + template T & operator[] ( _bi::value & v ) const { return v.get(); } -}; + template T const & operator[] ( _bi::value const & v ) const { return v.get(); } -template class bind_t: public bind_t_generator::BOOST_NESTED_TEMPLATE implementation -{ -public: + template T & operator[] ( reference_wrapper const & v ) const { return v.get(); } - bind_t(F f, L const & l): bind_t_generator::BOOST_NESTED_TEMPLATE implementation(f, l) {} + template typename result_traits::type operator[] ( bind_t & b ) const + { + rrlist a2( *this ); + return b.eval( a2 ); + } + template typename result_traits::type operator[] ( bind_t const & b ) const + { + rrlist a2( *this ); + return b.eval( a2 ); + } }; -#endif - -// function_equal +template class bind_t +{ +private: -#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP + F f_; + L l_; -// put overloads in _bi, rely on ADL +public: -# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + typedef typename result_traits::type result_type; + typedef bind_t this_type; -template bool function_equal( bind_t const & a, bind_t const & b ) -{ - return a.compare(b); -} + bind_t( F f, L const & l ): f_( std::move(f) ), l_( l ) {} -# else + // -template bool function_equal_impl( bind_t const & a, bind_t const & b, int ) -{ - return a.compare(b); -} + template result_type operator()( A&&... a ) + { + rrlist a2( a... ); + return l_( type(), f_, a2 ); + } -# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + template result_type operator()( A&&... a ) const + { + rrlist a2( a... ); + return l_( type(), f_, a2 ); + } -#else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP + // -// put overloads in boost + template result_type eval( A & a ) + { + return l_( type(), f_, a ); + } -} // namespace _bi + template result_type eval( A & a ) const + { + return l_( type(), f_, a ); + } -# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + template void accept( V & v ) const + { + using boost::visit_each; + visit_each( v, f_, 0 ); + l_.accept( v ); + } -template bool function_equal( _bi::bind_t const & a, _bi::bind_t const & b ) -{ - return a.compare(b); -} + bool compare( this_type const & rhs ) const + { + return ref_compare( f_, rhs.f_ ) && l_ == rhs.l_; + } +}; -# else +// function_equal -template bool function_equal_impl( _bi::bind_t const & a, _bi::bind_t const & b, int ) +template bool function_equal( bind_t const & a, bind_t const & b ) { return a.compare(b); } -# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - -namespace _bi -{ - -#endif // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP - // add_value -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530) - -#if defined( BOOST_BORLANDC ) && BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x582) ) - -template struct add_value -{ - typedef _bi::value type; -}; - -#else - template< class T, int I > struct add_value_2 { typedef boost::arg type; @@ -1563,8 +376,6 @@ template struct add_value typedef typename add_value_2< T, boost::is_placeholder< T >::value >::type type; }; -#endif - template struct add_value< value > { typedef _bi::value type; @@ -1590,135 +401,11 @@ template struct add_value< bind_t > typedef bind_t type; }; -#else - -template struct _avt_0; - -template<> struct _avt_0<1> -{ - template struct inner - { - typedef T type; - }; -}; - -template<> struct _avt_0<2> -{ - template struct inner - { - typedef value type; - }; -}; - -typedef char (&_avt_r1) [1]; -typedef char (&_avt_r2) [2]; - -template _avt_r1 _avt_f(value); -template _avt_r1 _avt_f(reference_wrapper); -template _avt_r1 _avt_f(arg); -template _avt_r1 _avt_f(arg (*) ()); -template _avt_r1 _avt_f(bind_t); - -_avt_r2 _avt_f(...); - -template struct add_value -{ - static T t(); - typedef typename _avt_0::template inner::type type; -}; - -#endif - -// list_av_N - -template struct list_av_1 -{ - typedef typename add_value::type B1; - typedef list1 type; -}; - -template struct list_av_2 -{ - typedef typename add_value::type B1; - typedef typename add_value::type B2; - typedef list2 type; -}; - -template struct list_av_3 -{ - typedef typename add_value::type B1; - typedef typename add_value::type B2; - typedef typename add_value::type B3; - typedef list3 type; -}; - -template struct list_av_4 -{ - typedef typename add_value::type B1; - typedef typename add_value::type B2; - typedef typename add_value::type B3; - typedef typename add_value::type B4; - typedef list4 type; -}; - -template struct list_av_5 -{ - typedef typename add_value::type B1; - typedef typename add_value::type B2; - typedef typename add_value::type B3; - typedef typename add_value::type B4; - typedef typename add_value::type B5; - typedef list5 type; -}; - -template struct list_av_6 -{ - typedef typename add_value::type B1; - typedef typename add_value::type B2; - typedef typename add_value::type B3; - typedef typename add_value::type B4; - typedef typename add_value::type B5; - typedef typename add_value::type B6; - typedef list6 type; -}; - -template struct list_av_7 -{ - typedef typename add_value::type B1; - typedef typename add_value::type B2; - typedef typename add_value::type B3; - typedef typename add_value::type B4; - typedef typename add_value::type B5; - typedef typename add_value::type B6; - typedef typename add_value::type B7; - typedef list7 type; -}; - -template struct list_av_8 -{ - typedef typename add_value::type B1; - typedef typename add_value::type B2; - typedef typename add_value::type B3; - typedef typename add_value::type B4; - typedef typename add_value::type B5; - typedef typename add_value::type B6; - typedef typename add_value::type B7; - typedef typename add_value::type B8; - typedef list8 type; -}; +// list_av -template struct list_av_9 +template struct list_av { - typedef typename add_value::type B1; - typedef typename add_value::type B2; - typedef typename add_value::type B3; - typedef typename add_value::type B4; - typedef typename add_value::type B5; - typedef typename add_value::type B6; - typedef typename add_value::type B7; - typedef typename add_value::type B8; - typedef typename add_value::type B9; - typedef list9 type; + typedef list< typename add_value::type... > type; }; // operator! @@ -1729,10 +416,10 @@ struct logical_not }; template - bind_t< bool, logical_not, list1< bind_t > > + bind_t< bool, logical_not, list< bind_t > > operator! (bind_t const & f) { - typedef list1< bind_t > list_type; + typedef list< bind_t > list_type; return bind_t ( logical_not(), list_type(f) ); } @@ -1746,11 +433,11 @@ struct name \ }; \ \ template \ - bind_t< bool, name, list2< bind_t, typename add_value::type > > \ + bind_t< bool, name, list< bind_t, typename add_value::type > > \ operator op (bind_t const & f, A2 a2) \ { \ typedef typename add_value::type B2; \ - typedef list2< bind_t, B2> list_type; \ + typedef list< bind_t, B2> list_type; \ return bind_t ( name(), list_type(f, a2) ); \ } @@ -1768,36 +455,12 @@ BOOST_BIND_OPERATOR( ||, logical_or ) #undef BOOST_BIND_OPERATOR -#if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3) - -// resolve ambiguity with rel_ops - -#define BOOST_BIND_OPERATOR( op, name ) \ -\ -template \ - bind_t< bool, name, list2< bind_t, bind_t > > \ - operator op (bind_t const & f, bind_t const & g) \ -{ \ - typedef list2< bind_t, bind_t > list_type; \ - return bind_t ( name(), list_type(f, g) ); \ -} - -BOOST_BIND_OPERATOR( !=, not_equal ) -BOOST_BIND_OPERATOR( <=, less_equal ) -BOOST_BIND_OPERATOR( >, greater ) -BOOST_BIND_OPERATOR( >=, greater_equal ) - -#endif - -// visit_each, ADL - -#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( BOOST_BORLANDC ) \ - && !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) +// visit_each template void visit_each( V & v, value const & t, int ) { using boost::visit_each; - BOOST_BIND_VISIT_EACH( v, t.get(), 0 ); + visit_each( v, t.get(), 0 ); } template void visit_each( V & v, bind_t const & t, int ) @@ -1805,27 +468,8 @@ template void visit_each( V & v, bind_t void visit_each( V & v, _bi::value const & t, int ) -{ - BOOST_BIND_VISIT_EACH( v, t.get(), 0 ); -} - -template void visit_each( V & v, _bi::bind_t const & t, int ) -{ - t.accept( v ); -} - -#endif - // is_bind_expression template< class T > struct is_bind_expression @@ -1833,15 +477,11 @@ template< class T > struct is_bind_expression enum _vt { value = 0 }; }; -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, F, L > > { enum _vt { value = 1 }; }; -#endif - // bind #ifndef BOOST_BIND @@ -1850,266 +490,135 @@ template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, // generic function objects -template - _bi::bind_t - BOOST_BIND(F f) -{ - typedef _bi::list0 list_type; - return _bi::bind_t (f, list_type()); -} - -template - _bi::bind_t::type> - BOOST_BIND(F f, A1 a1) -{ - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t (f, list_type(a1)); -} - -template - _bi::bind_t::type> - BOOST_BIND(F f, A1 a1, A2 a2) -{ - typedef typename _bi::list_av_2::type list_type; - return _bi::bind_t (f, list_type(a1, a2)); -} - -template - _bi::bind_t::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3) -{ - typedef typename _bi::list_av_3::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3)); -} - -template - _bi::bind_t::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4) -{ - typedef typename _bi::list_av_4::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4)); -} - -template - _bi::bind_t::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -{ - typedef typename _bi::list_av_5::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5)); -} - -template - _bi::bind_t::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -{ - typedef typename _bi::list_av_6::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6)); -} - -template - _bi::bind_t::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -{ - typedef typename _bi::list_av_7::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7)); -} +#if !BOOST_WORKAROUND(__GNUC__, < 6) -template - _bi::bind_t::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) +template + _bi::bind_t::type> + BOOST_BIND( F f, A... a ) { - typedef typename _bi::list_av_8::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a... ) ); } -template - _bi::bind_t::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) -{ - typedef typename _bi::list_av_9::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); -} +#else -// generic function objects, alternative syntax +// g++ 4.x (and some 5.x) consider boost::bind( &X::f ) +// ambiguous if the variadic form above is used template - _bi::bind_t - BOOST_BIND(boost::type, F f) + _bi::bind_t::type> + BOOST_BIND( F f ) { - typedef _bi::list0 list_type; - return _bi::bind_t (f, list_type()); + typedef typename _bi::list_av<>::type list_type; + return _bi::bind_t( std::move(f), list_type() ); } template - _bi::bind_t::type> - BOOST_BIND(boost::type, F f, A1 a1) + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1 ) { - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t (f, list_type(a1)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a1 ) ); } template - _bi::bind_t::type> - BOOST_BIND(boost::type, F f, A1 a1, A2 a2) + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2 ) { - typedef typename _bi::list_av_2::type list_type; - return _bi::bind_t (f, list_type(a1, a2)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a1, a2 ) ); } template - _bi::bind_t::type> - BOOST_BIND(boost::type, F f, A1 a1, A2 a2, A3 a3) + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3 ) { - typedef typename _bi::list_av_3::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a1, a2, a3 ) ); } template - _bi::bind_t::type> - BOOST_BIND(boost::type, F f, A1 a1, A2 a2, A3 a3, A4 a4) + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4 ) { - typedef typename _bi::list_av_4::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a1, a2, a3, a4 ) ); } template - _bi::bind_t::type> - BOOST_BIND(boost::type, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ) { - typedef typename _bi::list_av_5::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a1, a2, a3, a4, a5 ) ); } template - _bi::bind_t::type> - BOOST_BIND(boost::type, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ) { - typedef typename _bi::list_av_6::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a1, a2, a3, a4, a5, a6 ) ); } template - _bi::bind_t::type> - BOOST_BIND(boost::type, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ) { - typedef typename _bi::list_av_7::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a1, a2, a3, a4, a5, a6, a7 ) ); } template - _bi::bind_t::type> - BOOST_BIND(boost::type, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ) { - typedef typename _bi::list_av_8::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a1, a2, a3, a4, a5, a6, a7, a8 ) ); } template - _bi::bind_t::type> - BOOST_BIND(boost::type, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) -{ - typedef typename _bi::list_av_9::type list_type; - return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); -} - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) - -// adaptable function objects - -template - _bi::bind_t<_bi::unspecified, F, _bi::list0> - BOOST_BIND(F f) -{ - typedef _bi::list0 list_type; - return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type()); -} - -template - _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1::type> - BOOST_BIND(F f, A1 a1) -{ - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1)); -} - -template - _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2::type> - BOOST_BIND(F f, A1 a1, A2 a2) -{ - typedef typename _bi::list_av_2::type list_type; - return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2)); -} - -template - _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3) -{ - typedef typename _bi::list_av_3::type list_type; - return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3)); -} - -template - _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4) + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ) { - typedef typename _bi::list_av_4::type list_type; - return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a1, a2, a3, a4, a5, a6, a7, a8, a9 ) ); } -template - _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -{ - typedef typename _bi::list_av_5::type list_type; - return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5)); -} +#endif -template - _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -{ - typedef typename _bi::list_av_6::type list_type; - return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6)); -} +// generic function objects, alternative syntax -template - _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) +template + _bi::bind_t::type> + BOOST_BIND( boost::type, F f, A... a ) { - typedef typename _bi::list_av_7::type list_type; - return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( std::move(f), list_type( a... ) ); } -template - _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) -{ - typedef typename _bi::list_av_8::type list_type; - return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8)); -} +// adaptable function objects -template - _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9::type> - BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) +template + _bi::bind_t<_bi::unspecified, F, typename _bi::list_av::type> + BOOST_BIND( F f, A... a ) { - typedef typename _bi::list_av_9::type list_type; - return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); + typedef typename _bi::list_av::type list_type; + return _bi::bind_t<_bi::unspecified, F, list_type>( std::move(f), list_type( a... ) ); } -#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) - // function pointers #define BOOST_BIND_CC #define BOOST_BIND_ST #define BOOST_BIND_NOEXCEPT -#include +#include # if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED ) # undef BOOST_BIND_NOEXCEPT # define BOOST_BIND_NOEXCEPT noexcept -# include +# include # endif #undef BOOST_BIND_CC @@ -2122,7 +631,7 @@ template +#include #undef BOOST_BIND_CC #undef BOOST_BIND_ST @@ -2136,7 +645,7 @@ template +#include #undef BOOST_BIND_CC #undef BOOST_BIND_ST @@ -2150,7 +659,7 @@ template +#include #undef BOOST_BIND_ST #undef BOOST_BIND_CC @@ -2164,14 +673,14 @@ template -#include +#include +#include # if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED ) # undef BOOST_BIND_MF_NOEXCEPT # define BOOST_BIND_MF_NOEXCEPT noexcept -# include -# include +# include +# include # endif #undef BOOST_BIND_MF_NAME @@ -2184,8 +693,8 @@ template -#include +#include +#include #undef BOOST_BIND_MF_NAME #undef BOOST_BIND_MF_CC @@ -2199,8 +708,8 @@ template -#include +#include +#include #undef BOOST_BIND_MF_NAME #undef BOOST_BIND_MF_CC @@ -2214,8 +723,8 @@ template -#include +#include +#include #undef BOOST_BIND_MF_NAME #undef BOOST_BIND_MF_CC @@ -2225,65 +734,21 @@ template -_bi::bind_t< R, _mfi::dm, typename _bi::list_av_1::type > - BOOST_BIND(R T::*f, A1 a1) -{ - typedef _mfi::dm F; - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t( F(f), list_type(a1) ); -} - -#else - namespace _bi { -template< class Pm, int I > struct add_cref; +template struct add_cref; -template< class M, class T > struct add_cref< M T::*, 0 > +template struct add_cref { typedef M type; }; -template< class M, class T > struct add_cref< M T::*, 1 > -{ -#ifdef BOOST_MSVC -#pragma warning(push) -#pragma warning(disable:4180) -#endif - typedef M const & type; -#ifdef BOOST_MSVC -#pragma warning(pop) -#endif -}; - -template< class R, class T > struct add_cref< R (T::*) (), 1 > -{ - typedef void type; -}; - -#if !defined(__IBMCPP__) || __IBMCPP_FUNC_CV_TMPL_ARG_DEDUCTION - -template< class R, class T > struct add_cref< R (T::*) () const, 1 > -{ - typedef void type; -}; - -#if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED ) - -template< class R, class T > struct add_cref< R (T::*) () const noexcept, 1 > +template struct add_cref { - typedef void type; + typedef M const& type; }; -#endif // __cpp_noexcept_function_type - -#endif // __IBMCPP__ - template struct isref { enum value_type { value = 0 }; @@ -2299,37 +764,39 @@ template struct isref< R* > enum value_type { value = 1 }; }; -template struct dm_result +template::value> struct dm_result +{ +}; + +template struct dm_result { - typedef typename add_cref< Pm, 1 >::type type; + typedef typename add_cref< M, 1 >::type type; }; -template struct dm_result< Pm, bind_t > +template struct dm_result, false> { typedef typename bind_t::result_type result_type; - typedef typename add_cref< Pm, isref< result_type >::value >::type type; + typedef typename add_cref< M, isref< result_type >::value >::type type; }; } // namespace _bi -template< class A1, class M, class T > +template _bi::bind_t< - typename _bi::dm_result< M T::*, A1 >::type, + typename _bi::dm_result::type, _mfi::dm, - typename _bi::list_av_1::type + typename _bi::list_av::type > BOOST_BIND( M T::*f, A1 a1 ) { - typedef typename _bi::dm_result< M T::*, A1 >::type result_type; + typedef typename _bi::dm_result::type result_type; typedef _mfi::dm F; - typedef typename _bi::list_av_1::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) ); } -#endif - } // namespace boost #ifndef BOOST_BIND_NO_PLACEHOLDERS diff --git a/highlight-wrapper/boost/bind/bind_mf2_cc.hpp b/highlight-wrapper/boost/bind/bind_mf2_cc.hpp deleted file mode 100644 index be20b1d9..00000000 --- a/highlight-wrapper/boost/bind/bind_mf2_cc.hpp +++ /dev/null @@ -1,228 +0,0 @@ -// -// bind/bind_mf2_cc.hpp - member functions, type<> syntax -// -// Do not include this header directly. -// -// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. -// Copyright (c) 2008 Peter Dimov -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt -// -// See http://www.boost.org/libs/bind/bind.html for documentation. -// - -// 0 - -template - _bi::bind_t, typename _bi::list_av_1::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf0) F; - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t(F(f), list_type(a1)); -} - -template - _bi::bind_t, typename _bi::list_av_1::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf0) F; - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t(F(f), list_type(a1)); -} - -// 1 - -template - _bi::bind_t, typename _bi::list_av_2::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf1) F; - typedef typename _bi::list_av_2::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2)); -} - -template - _bi::bind_t, typename _bi::list_av_2::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf1) F; - typedef typename _bi::list_av_2::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2)); -} - -// 2 - -template - _bi::bind_t, typename _bi::list_av_3::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf2) F; - typedef typename _bi::list_av_3::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3)); -} - -template - _bi::bind_t, typename _bi::list_av_3::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf2) F; - typedef typename _bi::list_av_3::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3)); -} - -// 3 - -template - _bi::bind_t, typename _bi::list_av_4::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf3) F; - typedef typename _bi::list_av_4::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4)); -} - -template - _bi::bind_t, typename _bi::list_av_4::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf3) F; - typedef typename _bi::list_av_4::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4)); -} - -// 4 - -template - _bi::bind_t, typename _bi::list_av_5::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf4) F; - typedef typename _bi::list_av_5::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5)); -} - -template - _bi::bind_t, typename _bi::list_av_5::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf4) F; - typedef typename _bi::list_av_5::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5)); -} - -// 5 - -template - _bi::bind_t, typename _bi::list_av_6::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf5) F; - typedef typename _bi::list_av_6::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6)); -} - -template - _bi::bind_t, typename _bi::list_av_6::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf5) F; - typedef typename _bi::list_av_6::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6)); -} - -// 6 - -template - _bi::bind_t, typename _bi::list_av_7::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf6) F; - typedef typename _bi::list_av_7::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7)); -} - -template - _bi::bind_t, typename _bi::list_av_7::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf6) F; - typedef typename _bi::list_av_7::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7)); -} - -// 7 - -template - _bi::bind_t, typename _bi::list_av_8::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf7) F; - typedef typename _bi::list_av_8::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8)); -} - -template - _bi::bind_t, typename _bi::list_av_8::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf7) F; - typedef typename _bi::list_av_8::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8)); -} - -// 8 - -template - _bi::bind_t, typename _bi::list_av_9::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf8) F; - typedef typename _bi::list_av_9::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); -} - -template - _bi::bind_t, typename _bi::list_av_9::type> - BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf8) F; - typedef typename _bi::list_av_9::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); -} diff --git a/highlight-wrapper/boost/bind/bind_mf_cc.hpp b/highlight-wrapper/boost/bind/bind_mf_cc.hpp deleted file mode 100644 index 5a1610b4..00000000 --- a/highlight-wrapper/boost/bind/bind_mf_cc.hpp +++ /dev/null @@ -1,441 +0,0 @@ -// -// bind/bind_mf_cc.hpp - support for different calling conventions -// -// Do not include this header directly. -// -// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// See http://www.boost.org/libs/bind/bind.html for documentation. -// - -// 0 - -template - _bi::bind_t, typename _bi::list_av_1::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf0) F; - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t(F(f), list_type(a1)); -} - -template - _bi::bind_t, typename _bi::list_av_1::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf0) F; - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t(F(f), list_type(a1)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_1::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf0) F; - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t(F(f), list_type(a1)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_1::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf0) F; - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t(F(f), list_type(a1)); -} - -// 1 - -template - _bi::bind_t, typename _bi::list_av_2::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf1) F; - typedef typename _bi::list_av_2::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2)); -} - -template - _bi::bind_t, typename _bi::list_av_2::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf1) F; - typedef typename _bi::list_av_2::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_2::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf1) F; - typedef typename _bi::list_av_2::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_2::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf1) F; - typedef typename _bi::list_av_2::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2)); -} - -// 2 - -template - _bi::bind_t, typename _bi::list_av_3::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf2) F; - typedef typename _bi::list_av_3::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3)); -} - -template - _bi::bind_t, typename _bi::list_av_3::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf2) F; - typedef typename _bi::list_av_3::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_3::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf2) F; - typedef typename _bi::list_av_3::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_3::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf2) F; - typedef typename _bi::list_av_3::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3)); -} - -// 3 - -template - _bi::bind_t, typename _bi::list_av_4::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf3) F; - typedef typename _bi::list_av_4::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4)); -} - -template - _bi::bind_t, typename _bi::list_av_4::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf3) F; - typedef typename _bi::list_av_4::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_4::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf3) F; - typedef typename _bi::list_av_4::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_4::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf3) F; - typedef typename _bi::list_av_4::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4)); -} - -// 4 - -template - _bi::bind_t, typename _bi::list_av_5::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf4) F; - typedef typename _bi::list_av_5::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5)); -} - -template - _bi::bind_t, typename _bi::list_av_5::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf4) F; - typedef typename _bi::list_av_5::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_5::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf4) F; - typedef typename _bi::list_av_5::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_5::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf4) F; - typedef typename _bi::list_av_5::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5)); -} - -// 5 - -template - _bi::bind_t, typename _bi::list_av_6::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf5) F; - typedef typename _bi::list_av_6::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6)); -} - -template - _bi::bind_t, typename _bi::list_av_6::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf5) F; - typedef typename _bi::list_av_6::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_6::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf5) F; - typedef typename _bi::list_av_6::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_6::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf5) F; - typedef typename _bi::list_av_6::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6)); -} - -// 6 - -template - _bi::bind_t, typename _bi::list_av_7::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf6) F; - typedef typename _bi::list_av_7::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7)); -} - -template - _bi::bind_t, typename _bi::list_av_7::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf6) F; - typedef typename _bi::list_av_7::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_7::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf6) F; - typedef typename _bi::list_av_7::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_7::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf6) F; - typedef typename _bi::list_av_7::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7)); -} - -// 7 - -template - _bi::bind_t, typename _bi::list_av_8::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf7) F; - typedef typename _bi::list_av_8::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8)); -} - -template - _bi::bind_t, typename _bi::list_av_8::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf7) F; - typedef typename _bi::list_av_8::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_8::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf7) F; - typedef typename _bi::list_av_8::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_8::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf7) F; - typedef typename _bi::list_av_8::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8)); -} - -// 8 - -template - _bi::bind_t, typename _bi::list_av_9::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf8) F; - typedef typename _bi::list_av_9::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); -} - -template - _bi::bind_t, typename _bi::list_av_9::type> - BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf8) F; - typedef typename _bi::list_av_9::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_9::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) -{ - typedef _mfi::BOOST_BIND_MF_NAME(mf8) F; - typedef typename _bi::list_av_9::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); -} - -template - typename boost::enable_if_c::value, - _bi::bind_t, typename _bi::list_av_9::type> - >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) -{ - typedef _mfi::BOOST_BIND_MF_NAME(cmf8) F; - typedef typename _bi::list_av_9::type list_type; - return _bi::bind_t(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); -} diff --git a/highlight-wrapper/boost/bind/bind_template.hpp b/highlight-wrapper/boost/bind/bind_template.hpp deleted file mode 100644 index 212ced7f..00000000 --- a/highlight-wrapper/boost/bind/bind_template.hpp +++ /dev/null @@ -1,345 +0,0 @@ -// -// bind/bind_template.hpp -// -// Do not include this header directly. -// -// Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd. -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// See http://www.boost.org/libs/bind/bind.html for documentation. -// - - typedef typename result_traits::type result_type; - - result_type operator()() - { - list0 a; - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - result_type operator()() const - { - list0 a; - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1) - { - list1 a(a1); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1) const - { - list1 a(a1); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1) - { - list1 a(a1); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1) const - { - list1 a(a1); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2) - { - list2 a(a1, a2); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1, A2 & a2) const - { - list2 a(a1, a2); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 & a2) - { - list2 a(a1, a2); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1, A2 & a2) const - { - list2 a(a1, a2); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - - template result_type operator()(A1 & a1, A2 const & a2) - { - list2 a(a1, a2); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1, A2 const & a2) const - { - list2 a(a1, a2); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - - template result_type operator()(A1 const & a1, A2 const & a2) - { - list2 a(a1, a2); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1, A2 const & a2) const - { - list2 a(a1, a2); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3) - { - list3 a(a1, a2, a3); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3) const - { - list3 a(a1, a2, a3); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) - { - list3 a(a1, a2, a3); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) const - { - list3 a(a1, a2, a3); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) - { - list4 a(a1, a2, a3, a4); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const - { - list4 a(a1, a2, a3, a4); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) - { - list4 a(a1, a2, a3, a4); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) const - { - list4 a(a1, a2, a3, a4); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) - { - list5 a(a1, a2, a3, a4, a5); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const - { - list5 a(a1, a2, a3, a4, a5); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) - { - list5 a(a1, a2, a3, a4, a5); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) const - { - list5 a(a1, a2, a3, a4, a5); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) - { - list6 a(a1, a2, a3, a4, a5, a6); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const - { - list6 a(a1, a2, a3, a4, a5, a6); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) - { - list6 a(a1, a2, a3, a4, a5, a6); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) const - { - list6 a(a1, a2, a3, a4, a5, a6); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) - { - list7 a(a1, a2, a3, a4, a5, a6, a7); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const - { - list7 a(a1, a2, a3, a4, a5, a6, a7); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) - { - list7 a(a1, a2, a3, a4, a5, a6, a7); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) const - { - list7 a(a1, a2, a3, a4, a5, a6, a7); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) - { - list8 a(a1, a2, a3, a4, a5, a6, a7, a8); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const - { - list8 a(a1, a2, a3, a4, a5, a6, a7, a8); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) - { - list8 a(a1, a2, a3, a4, a5, a6, a7, a8); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) const - { - list8 a(a1, a2, a3, a4, a5, a6, a7, a8); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) - { - list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const - { - list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) - { - list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) const - { - list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - -#endif - - template result_type eval(A & a) - { - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template result_type eval(A & a) const - { - BOOST_BIND_RETURN l_(type(), f_, a, 0); - } - - template void accept(V & v) const - { -#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( BOOST_BORLANDC ) - - using boost::visit_each; - -#endif - BOOST_BIND_VISIT_EACH(v, f_, 0); - l_.accept(v); - } - - bool compare(this_type const & rhs) const - { - return ref_compare(f_, rhs.f_, 0) && l_ == rhs.l_; - } - -private: - - F f_; - L l_; diff --git a/highlight-wrapper/boost/bind/bind_cc.hpp b/highlight-wrapper/boost/bind/detail/bind_cc.hpp similarity index 78% rename from highlight-wrapper/boost/bind/bind_cc.hpp rename to highlight-wrapper/boost/bind/detail/bind_cc.hpp index 278aa9a2..fec86d4e 100644 --- a/highlight-wrapper/boost/bind/bind_cc.hpp +++ b/highlight-wrapper/boost/bind/detail/bind_cc.hpp @@ -13,105 +13,105 @@ // template - _bi::bind_t +_bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) () BOOST_BIND_NOEXCEPT) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) () BOOST_BIND_NOEXCEPT; - typedef _bi::list0 list_type; + typedef typename _bi::list_av<>::type list_type; return _bi::bind_t (f, list_type()); } template - _bi::bind_t::type> + _bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1) BOOST_BIND_NOEXCEPT, A1 a1) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1) BOOST_BIND_NOEXCEPT; - typedef typename _bi::list_av_1::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t (f, list_type(a1)); } template - _bi::bind_t::type> + _bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2) BOOST_BIND_NOEXCEPT; - typedef typename _bi::list_av_2::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t (f, list_type(a1, a2)); } template - _bi::bind_t::type> + _bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3) BOOST_BIND_NOEXCEPT; - typedef typename _bi::list_av_3::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3)); } template - _bi::bind_t::type> + _bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4) BOOST_BIND_NOEXCEPT; - typedef typename _bi::list_av_4::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4)); } template - _bi::bind_t::type> + _bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5) BOOST_BIND_NOEXCEPT; - typedef typename _bi::list_av_5::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5)); } template - _bi::bind_t::type> + _bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6) BOOST_BIND_NOEXCEPT; - typedef typename _bi::list_av_6::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6)); } template - _bi::bind_t::type> + _bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_NOEXCEPT; - typedef typename _bi::list_av_7::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7)); } template - _bi::bind_t::type> + _bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_NOEXCEPT; - typedef typename _bi::list_av_8::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8)); } template - _bi::bind_t::type> + _bi::bind_t::type> BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8, B9) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8, B9) BOOST_BIND_NOEXCEPT; - typedef typename _bi::list_av_9::type list_type; + typedef typename _bi::list_av::type list_type; return _bi::bind_t(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9)); } diff --git a/highlight-wrapper/boost/bind/detail/bind_mf2_cc.hpp b/highlight-wrapper/boost/bind/detail/bind_mf2_cc.hpp new file mode 100644 index 00000000..284f2417 --- /dev/null +++ b/highlight-wrapper/boost/bind/detail/bind_mf2_cc.hpp @@ -0,0 +1,210 @@ +// +// bind/bind_mf2_cc.hpp - member functions, type<> syntax +// +// Do not include this header directly. +// +// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2008 Peter Dimov +// +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// +// See http://www.boost.org/libs/bind/bind.html for documentation. +// + +// 0 + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1 ); +} + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1 ); +} + +// 1 + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2 ); +} + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2 ); +} + +// 2 + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3 ); +} + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3 ); +} + +// 3 + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4 ); +} + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4 ); +} + +// 4 + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5 ); +} + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5 ); +} + +// 5 + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ); +} + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ); +} + +// 6 + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ); +} + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ); +} + +// 7 + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ); +} + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ); +} + +// 8 + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ); +} + +template + auto + BOOST_BIND(boost::type, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) + -> decltype( boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) ) +{ + return boost::BOOST_BIND( boost::type(), boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ); +} diff --git a/highlight-wrapper/boost/bind/detail/bind_mf_cc.hpp b/highlight-wrapper/boost/bind/detail/bind_mf_cc.hpp new file mode 100644 index 00000000..2336ca20 --- /dev/null +++ b/highlight-wrapper/boost/bind/detail/bind_mf_cc.hpp @@ -0,0 +1,405 @@ +// +// bind/bind_mf_cc.hpp - support for different calling conventions +// +// Do not include this header directly. +// +// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/bind/bind.html for documentation. +// + +// 0 + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1 ); +} + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1 ); +} + +// 1 + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ); +} + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2 ); +} + +// 2 + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ); +} + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3 ); +} + +// 3 + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ); +} + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4 ); +} + +// 4 + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ); +} + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5 ); +} + +// 5 + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ); +} + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6 ); +} + +// 6 + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ); +} + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7 ); +} + +// 7 + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ); +} + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8 ); +} + +// 8 + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ); +} + +template + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ); +} + +template::value >::type> + auto + BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) + -> decltype( boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ) ) +{ + return boost::BOOST_BIND( boost::mem_fn( f ), a1, a2, a3, a4, a5, a6, a7, a8, a9 ); +} diff --git a/highlight-wrapper/boost/bind/detail/integer_sequence.hpp b/highlight-wrapper/boost/bind/detail/integer_sequence.hpp new file mode 100644 index 00000000..ce2c2b01 --- /dev/null +++ b/highlight-wrapper/boost/bind/detail/integer_sequence.hpp @@ -0,0 +1,111 @@ +#ifndef BOOST_BIND_DETAIL_INTEGER_SEQUENCE_HPP_INCLUDED +#define BOOST_BIND_DETAIL_INTEGER_SEQUENCE_HPP_INCLUDED + +// Copyright 2015, 2017, 2019 Peter Dimov. +// +// Distributed under the Boost Software License, Version 1.0. +// +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +#include + +#if defined(__has_builtin) +# if __has_builtin(__make_integer_seq) +# define BOOST_BIND_DETAIL_HAS_MAKE_INTEGER_SEQ +# endif +#endif + +namespace boost +{ +namespace _bi +{ + +// integer_sequence +template struct integer_sequence +{ +}; + +#if defined(BOOST_BIND_DETAIL_HAS_MAKE_INTEGER_SEQ) + +template using make_integer_sequence = __make_integer_seq; + +#else + +// detail::make_integer_sequence_impl +namespace detail +{ + +// iseq_if_c +template struct iseq_if_c_impl; + +template struct iseq_if_c_impl +{ + using type = T; +}; + +template struct iseq_if_c_impl +{ + using type = E; +}; + +template using iseq_if_c = typename iseq_if_c_impl::type; + +// iseq_identity +template struct iseq_identity +{ + using type = T; +}; + +template struct append_integer_sequence; + +template struct append_integer_sequence, integer_sequence> +{ + using type = integer_sequence< T, I..., ( J + sizeof...(I) )... >; +}; + +template struct make_integer_sequence_impl; + +template struct make_integer_sequence_impl_ +{ +private: + + static_assert( N >= 0, "make_integer_sequence: N must not be negative" ); + + static T const M = N / 2; + static T const R = N % 2; + + using S1 = typename make_integer_sequence_impl::type; + using S2 = typename append_integer_sequence::type; + using S3 = typename make_integer_sequence_impl::type; + using S4 = typename append_integer_sequence::type; + +public: + + using type = S4; +}; + +template struct make_integer_sequence_impl: iseq_if_c>, iseq_if_c>, make_integer_sequence_impl_ > > +{ +}; + +} // namespace detail + +// make_integer_sequence +template using make_integer_sequence = typename detail::make_integer_sequence_impl::type; + +#endif // defined(BOOST_BIND_DETAIL_HAS_MAKE_INTEGER_SEQ) + +// index_sequence +template using index_sequence = integer_sequence; + +// make_index_sequence +template using make_index_sequence = make_integer_sequence; + +// index_sequence_for +template using index_sequence_for = make_integer_sequence; + +} // namespace _bi +} // namespace boost + +#endif // #ifndef BOOST_BIND_DETAIL_INTEGER_SEQUENCE_HPP_INCLUDED diff --git a/highlight-wrapper/boost/bind/detail/is_same.hpp b/highlight-wrapper/boost/bind/detail/is_same.hpp deleted file mode 100644 index 995b39f4..00000000 --- a/highlight-wrapper/boost/bind/detail/is_same.hpp +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef BOOST_BIND_DETAIL_IS_SAME_HPP_INCLUDED -#define BOOST_BIND_DETAIL_IS_SAME_HPP_INCLUDED - -// is_same::value is true when T1 == T2 -// -// Copyright 2014 Peter Dimov -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt - -#include - -#if defined(BOOST_HAS_PRAGMA_ONCE) -# pragma once -#endif - -namespace boost -{ -namespace _bi -{ - -template< class T1, class T2 > struct is_same -{ - BOOST_STATIC_CONSTANT( bool, value = false ); -}; - -template< class T > struct is_same< T, T > -{ - BOOST_STATIC_CONSTANT( bool, value = true ); -}; - -} // namespace _bi -} // namespace boost - -#endif // #ifndef BOOST_BIND_DETAIL_IS_SAME_HPP_INCLUDED diff --git a/highlight-wrapper/boost/bind/detail/requires_cxx11.hpp b/highlight-wrapper/boost/bind/detail/requires_cxx11.hpp deleted file mode 100644 index a104d067..00000000 --- a/highlight-wrapper/boost/bind/detail/requires_cxx11.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef BOOST_BIND_DETAIL_REQUIRES_CXX11_HPP_INCLUDED -#define BOOST_BIND_DETAIL_REQUIRES_CXX11_HPP_INCLUDED - -// Copyright 2023 Peter Dimov -// Distributed under the Boost Software License, Version 1.0. -// https://www.boost.org/LICENSE_1_0.txt - -#include -#include - -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \ - defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ - defined(BOOST_NO_CXX11_DECLTYPE) || \ - defined(BOOST_NO_CXX11_CONSTEXPR) || \ - defined(BOOST_NO_CXX11_NOEXCEPT) || \ - defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - -BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Bind 1.82 and will be removed in Boost.Bind 1.84. Please open an issue in https://github.com/boostorg/bind if you want it retained.") - -#endif - -#endif // #ifndef BOOST_BIND_DETAIL_REQUIRES_CXX11_HPP_INCLUDED diff --git a/highlight-wrapper/boost/bind/detail/tuple_for_each.hpp b/highlight-wrapper/boost/bind/detail/tuple_for_each.hpp new file mode 100644 index 00000000..d1eabff8 --- /dev/null +++ b/highlight-wrapper/boost/bind/detail/tuple_for_each.hpp @@ -0,0 +1,64 @@ +#ifndef BOOST_BIND_DETAIL_TUPLE_FOR_EACH_HPP_INCLUDED +#define BOOST_BIND_DETAIL_TUPLE_FOR_EACH_HPP_INCLUDED + +// Copyright 2015-2020, 2024 Peter Dimov. +// +// Distributed under the Boost Software License, Version 1.0. +// +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include +#include +#include + +#if defined(BOOST_MSVC) +# pragma warning( push ) +# pragma warning( disable: 4100 ) // unreferenced formal parameter 'tp' +#endif + +namespace boost +{ +namespace _bi +{ + +// tuple_for_each( f, tp ) + +template F tuple_for_each_impl( F&& f, Tp&& tp, integer_sequence ) +{ + using A = int[ 1 + sizeof...(J) ]; + using std::get; + return (void)A{ 0, ((void)f(get(std::forward(tp))), 0)... }, std::forward(f); +} + +template F tuple_for_each( F&& f, Tp&& tp ) +{ + using seq = make_index_sequence::type>::value>; + return _bi::tuple_for_each_impl( std::forward(f), std::forward(tp), seq() ); +} + +// tuple_for_each( f, tp1, tp2 ) + +template F tuple_for_each_impl( F&& f, Tp1&& tp1, Tp2&& tp2, integer_sequence ) +{ + using A = int[ 1 + sizeof...(J) ]; + using std::get; + return (void)A{ 0, ((void)f( get(std::forward(tp1)), get(std::forward(tp2)) ), 0)... }, std::forward(f); +} + +template F tuple_for_each( F&& f, Tp1&& tp1, Tp2&& tp2 ) +{ + using seq = make_index_sequence::type>::value>; + return _bi::tuple_for_each_impl( std::forward(f), std::forward(tp1), std::forward(tp2), seq() ); +} + +} // namespace _bi +} // namespace boost + +#if defined(BOOST_MSVC) +# pragma warning( pop ) +#endif + +#endif // #ifndef BOOST_BIND_DETAIL_TUPLE_FOR_EACH_HPP_INCLUDED diff --git a/highlight-wrapper/boost/bind/mem_fn.hpp b/highlight-wrapper/boost/bind/mem_fn.hpp index 1078e7c5..5cfbb99e 100644 --- a/highlight-wrapper/boost/bind/mem_fn.hpp +++ b/highlight-wrapper/boost/bind/mem_fn.hpp @@ -8,318 +8,162 @@ #endif // -// mem_fn.hpp - a generalization of std::mem_fun[_ref] +// mem_fn.hpp - a generalization of std::mem_fun[_ref] // -// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. -// Copyright (c) 2001 David Abrahams -// Copyright (c) 2003-2005 Peter Dimov +// Copyright 2001-2005, 2024 Peter Dimov +// Copyright 2001 David Abrahams // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -// See http://www.boost.org/libs/bind/mem_fn.html for documentation. +// See http://www.boost.org/libs/bind/mem_fn.html for documentation. // -#include #include #include #include +#include namespace boost { -#if defined(BOOST_NO_VOID_RETURNS) - -#define BOOST_MEM_FN_CLASS_F , class F -#define BOOST_MEM_FN_TYPEDEF(X) - -namespace _mfi // mem_fun_impl +namespace _mfi { -template struct mf +template struct remove_cvref: std::remove_cv< typename std::remove_reference::type > { +}; -#define BOOST_MEM_FN_RETURN return - -#define BOOST_MEM_FN_NAME(X) inner_##X -#define BOOST_MEM_FN_CC - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64) - -#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl -#define BOOST_MEM_FN_CC __cdecl - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#endif - -#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64) - -#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall -#define BOOST_MEM_FN_CC __stdcall - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#endif - -#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64) - -#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall -#define BOOST_MEM_FN_CC __fastcall - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#endif - -#undef BOOST_MEM_FN_RETURN - -}; // struct mf - -template<> struct mf +template class mf { +public: -#define BOOST_MEM_FN_RETURN - -#define BOOST_MEM_FN_NAME(X) inner_##X -#define BOOST_MEM_FN_CC - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64) - -#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl -#define BOOST_MEM_FN_CC __cdecl - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#endif - -#ifdef BOOST_MEM_FN_ENABLE_STDCALL - -#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall -#define BOOST_MEM_FN_CC __stdcall - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#endif - -#ifdef BOOST_MEM_FN_ENABLE_FASTCALL - -#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall -#define BOOST_MEM_FN_CC __fastcall - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#endif - -#undef BOOST_MEM_FN_RETURN - -}; // struct mf - -#undef BOOST_MEM_FN_CLASS_F -#undef BOOST_MEM_FN_TYPEDEF_F - -#define BOOST_MEM_FN_NAME(X) X -#define BOOST_MEM_FN_NAME2(X) inner_##X -#define BOOST_MEM_FN_CC - -#include - -#undef BOOST_MEM_FN_NAME -#undef BOOST_MEM_FN_NAME2 -#undef BOOST_MEM_FN_CC - -#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64) - -#define BOOST_MEM_FN_NAME(X) X##_cdecl -#define BOOST_MEM_FN_NAME2(X) inner_##X##_cdecl -#define BOOST_MEM_FN_CC __cdecl - -#include - -#undef BOOST_MEM_FN_NAME -#undef BOOST_MEM_FN_NAME2 -#undef BOOST_MEM_FN_CC - -#endif + typedef R result_type; -#ifdef BOOST_MEM_FN_ENABLE_STDCALL +private: -#define BOOST_MEM_FN_NAME(X) X##_stdcall -#define BOOST_MEM_FN_NAME2(X) inner_##X##_stdcall -#define BOOST_MEM_FN_CC __stdcall + Pm pm_; -#include +public: -#undef BOOST_MEM_FN_NAME -#undef BOOST_MEM_FN_NAME2 -#undef BOOST_MEM_FN_CC + mf( Pm pm ): pm_( pm ) {} -#endif + template::type, + class En = typename std::enable_if< + std::is_same::value || std::is_base_of::value + >::type + > -#ifdef BOOST_MEM_FN_ENABLE_FASTCALL + R operator()( U&& u, A... a ) const + { + return (std::forward( u ).*pm_)( std::forward( a )... ); + } -#define BOOST_MEM_FN_NAME(X) X##_fastcall -#define BOOST_MEM_FN_NAME2(X) inner_##X##_fastcall -#define BOOST_MEM_FN_CC __fastcall + template::type, + class E1 = void, + class En = typename std::enable_if< + !(std::is_same::value || std::is_base_of::value) + >::type + > -#include + R operator()( U&& u, A... a ) const + { + return (get_pointer( std::forward( u ) )->*pm_)( std::forward( a )... ); + } -#undef BOOST_MEM_FN_NAME -#undef BOOST_MEM_FN_NAME2 -#undef BOOST_MEM_FN_CC + bool operator==( mf const & rhs ) const + { + return pm_ == rhs.pm_; + } -#endif + bool operator!=( mf const & rhs ) const + { + return pm_ != rhs.pm_; + } +}; } // namespace _mfi -#else // #ifdef BOOST_NO_VOID_RETURNS - -#define BOOST_MEM_FN_CLASS_F -#define BOOST_MEM_FN_TYPEDEF(X) typedef X; +// -namespace _mfi +template +auto mem_fn( R (T::*pmf) (A...) ) -> _mfi::mf { + return pmf; +} -#define BOOST_MEM_FN_RETURN return - -#define BOOST_MEM_FN_NAME(X) X -#define BOOST_MEM_FN_CC - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64) - -#define BOOST_MEM_FN_NAME(X) X##_cdecl -#define BOOST_MEM_FN_CC __cdecl - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#endif - -#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64) - -#define BOOST_MEM_FN_NAME(X) X##_stdcall -#define BOOST_MEM_FN_CC __stdcall - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#endif - -#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64) - -#define BOOST_MEM_FN_NAME(X) X##_fastcall -#define BOOST_MEM_FN_CC __fastcall - -#include - -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NAME - -#endif - -#undef BOOST_MEM_FN_RETURN - -} // namespace _mfi - -#undef BOOST_MEM_FN_CLASS_F -#undef BOOST_MEM_FN_TYPEDEF - -#endif // #ifdef BOOST_NO_VOID_RETURNS +template +auto mem_fn( R (T::*pmf) (A...) const ) -> _mfi::mf +{ + return pmf; +} -#define BOOST_MEM_FN_NAME(X) X -#define BOOST_MEM_FN_CC -#define BOOST_MEM_FN_NOEXCEPT +#if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED ) -#include +template +auto mem_fn( R (T::*pmf) (A...) noexcept ) -> _mfi::mf +{ + return pmf; +} -#if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED ) -# undef BOOST_MEM_FN_NOEXCEPT -# define BOOST_MEM_FN_NOEXCEPT noexcept -# include -#endif +template +auto mem_fn( R (T::*pmf) (A...) const noexcept ) -> _mfi::mf +{ + return pmf; +} -#undef BOOST_MEM_FN_NAME -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NOEXCEPT +#endif // #if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED ) #if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64) -#define BOOST_MEM_FN_NAME(X) X##_cdecl -#define BOOST_MEM_FN_CC __cdecl -#define BOOST_MEM_FN_NOEXCEPT +template +auto mem_fn( R (__cdecl T::*pmf) (A...) ) -> _mfi::mf +{ + return pmf; +} -#include +template +auto mem_fn( R (__cdecl T::*pmf) (A...) const ) -> _mfi::mf +{ + return pmf; +} -#undef BOOST_MEM_FN_NAME -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NOEXCEPT - -#endif +#endif // #if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64) #if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64) -#define BOOST_MEM_FN_NAME(X) X##_stdcall -#define BOOST_MEM_FN_CC __stdcall -#define BOOST_MEM_FN_NOEXCEPT - -#include +template +auto mem_fn( R (__stdcall T::*pmf) (A...) ) -> _mfi::mf +{ + return pmf; +} -#undef BOOST_MEM_FN_NAME -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NOEXCEPT +template +auto mem_fn( R (__stdcall T::*pmf) (A...) const ) -> _mfi::mf +{ + return pmf; +} -#endif +#endif // #if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64) #if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64) -#define BOOST_MEM_FN_NAME(X) X##_fastcall -#define BOOST_MEM_FN_CC __fastcall -#define BOOST_MEM_FN_NOEXCEPT - -#include +template +auto mem_fn( R (__fastcall T::*pmf) (A...) ) -> _mfi::mf +{ + return pmf; +} -#undef BOOST_MEM_FN_NAME -#undef BOOST_MEM_FN_CC -#undef BOOST_MEM_FN_NOEXCEPT +template +auto mem_fn( R (__fastcall T::*pmf) (A...) const ) -> _mfi::mf +{ + return pmf; +} -#endif +#endif // #if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64) // data member support @@ -334,69 +178,74 @@ template class dm typedef T const * argument_type; private: - - typedef R (T::*F); - F f_; - template R const & call(U & u, T const *) const - { - return (u.*f_); - } - - template R const & call(U & u, void const *) const - { - return (get_pointer(u)->*f_); - } + typedef R (T::*Pm); + Pm pm_; public: - - explicit dm(F f): f_(f) {} - R & operator()(T * p) const - { - return (p->*f_); - } + dm( Pm pm ): pm_( pm ) {} - R const & operator()(T const * p) const + template::type, + class En = typename std::enable_if< + std::is_same::value || std::is_base_of::value + >::type + > + + auto operator()( U&& u ) const -> decltype( std::forward( u ).*pm_ ) { - return (p->*f_); + return std::forward( u ).*pm_; } - template R const & operator()(U const & u) const + template::type, + class E1 = void, + class En = typename std::enable_if< + !(std::is_same::value || std::is_base_of::value) + >::type + > + + auto operator()( U&& u ) const -> decltype( get_pointer( std::forward( u ) )->*pm_ ) { - return call(u, &u); + return get_pointer( std::forward( u ) )->*pm_; } -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, < 0x3200) +#if BOOST_WORKAROUND(BOOST_MSVC, < 1910) - R & operator()(T & t) const + template + R& operator()( U* u ) const { - return (t.*f_); + return u->*pm_; } - R const & operator()(T const & t) const + template + R const& operator()( U const* u ) const { - return (t.*f_); + return u->*pm_; } #endif - bool operator==(dm const & rhs) const + bool operator==( dm const & rhs ) const { - return f_ == rhs.f_; + return pm_ == rhs.pm_; } - bool operator!=(dm const & rhs) const + bool operator!=( dm const & rhs ) const { - return f_ != rhs.f_; + return pm_ != rhs.pm_; } }; } // namespace _mfi -template _mfi::dm mem_fn(R T::*f) +template::value >::type +> +_mfi::dm mem_fn( R T::*pm ) { - return _mfi::dm(f); + return pm; } } // namespace boost diff --git a/highlight-wrapper/boost/bind/mem_fn_cc.hpp b/highlight-wrapper/boost/bind/mem_fn_cc.hpp deleted file mode 100644 index 03e38300..00000000 --- a/highlight-wrapper/boost/bind/mem_fn_cc.hpp +++ /dev/null @@ -1,103 +0,0 @@ -// -// bind/mem_fn_cc.hpp - support for different calling conventions -// -// Do not include this header directly. -// -// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// See http://www.boost.org/libs/bind/mem_fn.html for documentation. -// - -template _mfi::BOOST_MEM_FN_NAME(mf0) mem_fn(R (BOOST_MEM_FN_CC T::*f) () BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(mf0)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(cmf0) mem_fn(R (BOOST_MEM_FN_CC T::*f) () const BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(cmf0)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(mf1) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1) BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(mf1)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(cmf1) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1) const BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(cmf1)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(mf2) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2) BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(mf2)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(cmf2) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2) const BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(cmf2)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(mf3) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3) BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(mf3)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(cmf3) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3) const BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(cmf3)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(mf4) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4) BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(mf4)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(cmf4) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4) const BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(cmf4)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(mf5) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5) BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(mf5)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(cmf5) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5) const BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(cmf5)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(mf6) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6) BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(mf6)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(cmf6) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6) const BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(cmf6)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(mf7) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7) BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(mf7)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(cmf7) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7) const BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(cmf7)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(mf8) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7, A8) BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(mf8)(f); -} - -template _mfi::BOOST_MEM_FN_NAME(cmf8) mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7, A8) const BOOST_MEM_FN_NOEXCEPT) -{ - return _mfi::BOOST_MEM_FN_NAME(cmf8)(f); -} diff --git a/highlight-wrapper/boost/bind/mem_fn_template.hpp b/highlight-wrapper/boost/bind/mem_fn_template.hpp deleted file mode 100644 index b26d585d..00000000 --- a/highlight-wrapper/boost/bind/mem_fn_template.hpp +++ /dev/null @@ -1,1047 +0,0 @@ -// -// bind/mem_fn_template.hpp -// -// Do not include this header directly -// -// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// See http://www.boost.org/libs/bind/mem_fn.html for documentation. -// - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) -# define BOOST_MEM_FN_ENABLE_CONST_OVERLOADS -#endif - -// mf0 - -template class BOOST_MEM_FN_NAME(mf0) -{ -public: - - typedef R result_type; - typedef T * argument_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) ()) - F f_; - - template R call(U & u, T const *) const - { - BOOST_MEM_FN_RETURN (u.*f_)(); - } - - template R call(U & u, void const *) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(); - } - -public: - - explicit BOOST_MEM_FN_NAME(mf0)(F f): f_(f) {} - - R operator()(T * p) const - { - BOOST_MEM_FN_RETURN (p->*f_)(); - } - - template R operator()(U & u) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p); - } - -#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS - - template R operator()(U const & u) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p); - } - -#endif - - R operator()(T & t) const - { - BOOST_MEM_FN_RETURN (t.*f_)(); - } - - bool operator==(BOOST_MEM_FN_NAME(mf0) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(mf0) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// cmf0 - -template class BOOST_MEM_FN_NAME(cmf0) -{ -public: - - typedef R result_type; - typedef T const * argument_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) () const) - F f_; - - template R call(U & u, T const *) const - { - BOOST_MEM_FN_RETURN (u.*f_)(); - } - - template R call(U & u, void const *) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(); - } - -public: - - explicit BOOST_MEM_FN_NAME(cmf0)(F f): f_(f) {} - - template R operator()(U const & u) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p); - } - - R operator()(T const & t) const - { - BOOST_MEM_FN_RETURN (t.*f_)(); - } - - bool operator==(BOOST_MEM_FN_NAME(cmf0) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(cmf0) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// mf1 - -template class BOOST_MEM_FN_NAME(mf1) -{ -public: - - typedef R result_type; - typedef T * first_argument_type; - typedef A1 second_argument_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1)) - F f_; - - template R call(U & u, T const *, B1 & b1) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1); - } - - template R call(U & u, void const *, B1 & b1) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1); - } - -public: - - explicit BOOST_MEM_FN_NAME(mf1)(F f): f_(f) {} - - R operator()(T * p, A1 a1) const - { - BOOST_MEM_FN_RETURN (p->*f_)(a1); - } - - template R operator()(U & u, A1 a1) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1); - } - -#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS - - template R operator()(U const & u, A1 a1) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1); - } - -#endif - - R operator()(T & t, A1 a1) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1); - } - - bool operator==(BOOST_MEM_FN_NAME(mf1) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(mf1) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// cmf1 - -template class BOOST_MEM_FN_NAME(cmf1) -{ -public: - - typedef R result_type; - typedef T const * first_argument_type; - typedef A1 second_argument_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1) const) - F f_; - - template R call(U & u, T const *, B1 & b1) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1); - } - - template R call(U & u, void const *, B1 & b1) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1); - } - -public: - - explicit BOOST_MEM_FN_NAME(cmf1)(F f): f_(f) {} - - template R operator()(U const & u, A1 a1) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1); - } - - R operator()(T const & t, A1 a1) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1); - } - - bool operator==(BOOST_MEM_FN_NAME(cmf1) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(cmf1) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// mf2 - -template class BOOST_MEM_FN_NAME(mf2) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2)) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2); - } - -public: - - explicit BOOST_MEM_FN_NAME(mf2)(F f): f_(f) {} - - R operator()(T * p, A1 a1, A2 a2) const - { - BOOST_MEM_FN_RETURN (p->*f_)(a1, a2); - } - - template R operator()(U & u, A1 a1, A2 a2) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2); - } - -#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS - - template R operator()(U const & u, A1 a1, A2 a2) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2); - } - -#endif - - R operator()(T & t, A1 a1, A2 a2) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2); - } - - bool operator==(BOOST_MEM_FN_NAME(mf2) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(mf2) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// cmf2 - -template class BOOST_MEM_FN_NAME(cmf2) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2) const) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2); - } - -public: - - explicit BOOST_MEM_FN_NAME(cmf2)(F f): f_(f) {} - - template R operator()(U const & u, A1 a1, A2 a2) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2); - } - - R operator()(T const & t, A1 a1, A2 a2) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2); - } - - bool operator==(BOOST_MEM_FN_NAME(cmf2) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(cmf2) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// mf3 - -template class BOOST_MEM_FN_NAME(mf3) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3)) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3); - } - -public: - - explicit BOOST_MEM_FN_NAME(mf3)(F f): f_(f) {} - - R operator()(T * p, A1 a1, A2 a2, A3 a3) const - { - BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3); - } - - template R operator()(U & u, A1 a1, A2 a2, A3 a3) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); - } - -#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); - } - -#endif - - R operator()(T & t, A1 a1, A2 a2, A3 a3) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3); - } - - bool operator==(BOOST_MEM_FN_NAME(mf3) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(mf3) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// cmf3 - -template class BOOST_MEM_FN_NAME(cmf3) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3) const) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3); - } - -public: - - explicit BOOST_MEM_FN_NAME(cmf3)(F f): f_(f) {} - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); - } - - R operator()(T const & t, A1 a1, A2 a2, A3 a3) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3); - } - - bool operator==(BOOST_MEM_FN_NAME(cmf3) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(cmf3) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// mf4 - -template class BOOST_MEM_FN_NAME(mf4) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4)) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4); - } - -public: - - explicit BOOST_MEM_FN_NAME(mf4)(F f): f_(f) {} - - R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4) const - { - BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4); - } - - template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); - } - -#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); - } - -#endif - - R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4); - } - - bool operator==(BOOST_MEM_FN_NAME(mf4) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(mf4) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// cmf4 - -template class BOOST_MEM_FN_NAME(cmf4) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4); - } - -public: - - explicit BOOST_MEM_FN_NAME(cmf4)(F f): f_(f) {} - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); - } - - R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4); - } - - bool operator==(BOOST_MEM_FN_NAME(cmf4) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(cmf4) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// mf5 - -template class BOOST_MEM_FN_NAME(mf5) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5)) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5); - } - -public: - - explicit BOOST_MEM_FN_NAME(mf5)(F f): f_(f) {} - - R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const - { - BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5); - } - - template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); - } - -#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); - } - -#endif - - R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5); - } - - bool operator==(BOOST_MEM_FN_NAME(mf5) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(mf5) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// cmf5 - -template class BOOST_MEM_FN_NAME(cmf5) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5); - } - -public: - - explicit BOOST_MEM_FN_NAME(cmf5)(F f): f_(f) {} - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); - } - - R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5); - } - - bool operator==(BOOST_MEM_FN_NAME(cmf5) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(cmf5) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// mf6 - -template class BOOST_MEM_FN_NAME(mf6) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6)) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6); - } - -public: - - explicit BOOST_MEM_FN_NAME(mf6)(F f): f_(f) {} - - R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const - { - BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6); - } - - template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); - } - -#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); - } - -#endif - - R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6); - } - - bool operator==(BOOST_MEM_FN_NAME(mf6) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(mf6) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// cmf6 - -template class BOOST_MEM_FN_NAME(cmf6) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6); - } - -public: - - explicit BOOST_MEM_FN_NAME(cmf6)(F f): f_(f) {} - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); - } - - R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6); - } - - bool operator==(BOOST_MEM_FN_NAME(cmf6) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(cmf6) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// mf7 - -template class BOOST_MEM_FN_NAME(mf7) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7)) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7); - } - -public: - - explicit BOOST_MEM_FN_NAME(mf7)(F f): f_(f) {} - - R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const - { - BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7); - } - - template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); - } - -#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); - } - -#endif - - R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7); - } - - bool operator==(BOOST_MEM_FN_NAME(mf7) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(mf7) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// cmf7 - -template class BOOST_MEM_FN_NAME(cmf7) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7); - } - -public: - - explicit BOOST_MEM_FN_NAME(cmf7)(F f): f_(f) {} - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); - } - - R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7); - } - - bool operator==(BOOST_MEM_FN_NAME(cmf7) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(cmf7) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// mf8 - -template class BOOST_MEM_FN_NAME(mf8) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8)) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8); - } - -public: - - explicit BOOST_MEM_FN_NAME(mf8)(F f): f_(f) {} - - R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const - { - BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8); - } - - template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); - } - -#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); - } - -#endif - - R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8); - } - - bool operator==(BOOST_MEM_FN_NAME(mf8) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(mf8) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -// cmf8 - -template class BOOST_MEM_FN_NAME(cmf8) -{ -public: - - typedef R result_type; - -private: - - BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const) - F f_; - - template R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const - { - BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8); - } - - template R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const - { - BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8); - } - -public: - - explicit BOOST_MEM_FN_NAME(cmf8)(F f): f_(f) {} - - R operator()(T const * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const - { - BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8); - } - - template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const - { - U const * p = 0; - BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); - } - - R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const - { - BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8); - } - - bool operator==(BOOST_MEM_FN_NAME(cmf8) const & rhs) const - { - return f_ == rhs.f_; - } - - bool operator!=(BOOST_MEM_FN_NAME(cmf8) const & rhs) const - { - return f_ != rhs.f_; - } -}; - -#undef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS diff --git a/highlight-wrapper/boost/bind/mem_fn_vw.hpp b/highlight-wrapper/boost/bind/mem_fn_vw.hpp deleted file mode 100644 index f3fc58db..00000000 --- a/highlight-wrapper/boost/bind/mem_fn_vw.hpp +++ /dev/null @@ -1,130 +0,0 @@ -// -// bind/mem_fn_vw.hpp - void return helper wrappers -// -// Do not include this header directly -// -// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// See http://www.boost.org/libs/bind/mem_fn.html for documentation. -// - -template struct BOOST_MEM_FN_NAME(mf0): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf0) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (); - explicit BOOST_MEM_FN_NAME(mf0)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf0)(f) {} -}; - -template struct BOOST_MEM_FN_NAME(cmf0): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf0) -{ - typedef R (BOOST_MEM_FN_CC T::*F) () const; - explicit BOOST_MEM_FN_NAME(cmf0)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf0)(f) {} -}; - - -template struct BOOST_MEM_FN_NAME(mf1): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf1) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1); - explicit BOOST_MEM_FN_NAME(mf1)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf1)(f) {} -}; - -template struct BOOST_MEM_FN_NAME(cmf1): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf1) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1) const; - explicit BOOST_MEM_FN_NAME(cmf1)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf1)(f) {} -}; - - -template struct BOOST_MEM_FN_NAME(mf2): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf2) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2); - explicit BOOST_MEM_FN_NAME(mf2)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf2)(f) {} -}; - -template struct BOOST_MEM_FN_NAME(cmf2): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf2) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2) const; - explicit BOOST_MEM_FN_NAME(cmf2)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf2)(f) {} -}; - - -template struct BOOST_MEM_FN_NAME(mf3): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf3) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3); - explicit BOOST_MEM_FN_NAME(mf3)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf3)(f) {} -}; - -template struct BOOST_MEM_FN_NAME(cmf3): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf3) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3) const; - explicit BOOST_MEM_FN_NAME(cmf3)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf3)(f) {} -}; - - -template struct BOOST_MEM_FN_NAME(mf4): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf4) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4); - explicit BOOST_MEM_FN_NAME(mf4)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf4)(f) {} -}; - -template struct BOOST_MEM_FN_NAME(cmf4): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf4) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const; - explicit BOOST_MEM_FN_NAME(cmf4)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf4)(f) {} -}; - - -template struct BOOST_MEM_FN_NAME(mf5): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf5) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5); - explicit BOOST_MEM_FN_NAME(mf5)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf5)(f) {} -}; - -template struct BOOST_MEM_FN_NAME(cmf5): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf5) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const; - explicit BOOST_MEM_FN_NAME(cmf5)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf5)(f) {} -}; - - -template struct BOOST_MEM_FN_NAME(mf6): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf6) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6); - explicit BOOST_MEM_FN_NAME(mf6)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf6)(f) {} -}; - -template struct BOOST_MEM_FN_NAME(cmf6): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf6) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const; - explicit BOOST_MEM_FN_NAME(cmf6)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf6)(f) {} -}; - - -template struct BOOST_MEM_FN_NAME(mf7): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf7) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7); - explicit BOOST_MEM_FN_NAME(mf7)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf7)(f) {} -}; - -template struct BOOST_MEM_FN_NAME(cmf7): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf7) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const; - explicit BOOST_MEM_FN_NAME(cmf7)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf7)(f) {} -}; - - -template struct BOOST_MEM_FN_NAME(mf8): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf8) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8); - explicit BOOST_MEM_FN_NAME(mf8)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf8)(f) {} -}; - -template struct BOOST_MEM_FN_NAME(cmf8): public mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf8) -{ - typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const; - explicit BOOST_MEM_FN_NAME(cmf8)(F f): mf::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf8)(f) {} -}; - diff --git a/highlight-wrapper/boost/bind/placeholders.hpp b/highlight-wrapper/boost/bind/placeholders.hpp index 5e4b96d8..2daba9e9 100644 --- a/highlight-wrapper/boost/bind/placeholders.hpp +++ b/highlight-wrapper/boost/bind/placeholders.hpp @@ -10,14 +10,13 @@ // // bind/placeholders.hpp - _N definitions // -// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. -// Copyright 2015 Peter Dimov +// Copyright 2002, 2015, 2024 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // -// See http://www.boost.org/libs/bind/bind.html for documentation. +// See http://www.boost.org/libs/bind for documentation. // #include @@ -29,19 +28,7 @@ namespace boost namespace placeholders { -#if defined(BOOST_BORLANDC) || defined(__GNUC__) && (__GNUC__ < 4) - -inline boost::arg<1> _1() { return boost::arg<1>(); } -inline boost::arg<2> _2() { return boost::arg<2>(); } -inline boost::arg<3> _3() { return boost::arg<3>(); } -inline boost::arg<4> _4() { return boost::arg<4>(); } -inline boost::arg<5> _5() { return boost::arg<5>(); } -inline boost::arg<6> _6() { return boost::arg<6>(); } -inline boost::arg<7> _7() { return boost::arg<7>(); } -inline boost::arg<8> _8() { return boost::arg<8>(); } -inline boost::arg<9> _9() { return boost::arg<9>(); } - -#elif !defined(BOOST_NO_CXX17_INLINE_VARIABLES) +#if !defined(BOOST_NO_CXX17_INLINE_VARIABLES) BOOST_INLINE_CONSTEXPR boost::arg<1> _1; BOOST_INLINE_CONSTEXPR boost::arg<2> _2; diff --git a/highlight-wrapper/boost/bind/protect.hpp b/highlight-wrapper/boost/bind/protect.hpp index 9c7c120a..f6914594 100644 --- a/highlight-wrapper/boost/bind/protect.hpp +++ b/highlight-wrapper/boost/bind/protect.hpp @@ -12,9 +12,6 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include -#include -#include #include namespace boost @@ -23,8 +20,6 @@ namespace boost namespace _bi { -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !(defined(BOOST_GCC) && BOOST_GCC < 40600) - template struct protect_make_void { typedef void type; @@ -62,281 +57,6 @@ template class protected_bind_t: public protect_result_type } }; -#else - -template class protected_bind_t -{ -private: - - F f_; - -public: - - typedef typename F::result_type result_type; - - explicit protected_bind_t(F f): f_(f) - { - } - - result_type operator()() - { - return f_(); - } - - result_type operator()() const - { - return f_(); - } - - template result_type operator()(A1 & a1) - { - return f_(a1); - } - - template result_type operator()(A1 & a1) const - { - return f_(a1); - } - - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(const A1 & a1) - { - return f_(a1); - } - - template result_type operator()(const A1 & a1) const - { - return f_(a1); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2) - { - return f_(a1, a2); - } - - template result_type operator()(A1 & a1, A2 & a2) const - { - return f_(a1, a2); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 & a2) - { - return f_(a1, a2); - } - - template result_type operator()(A1 const & a1, A2 & a2) const - { - return f_(a1, a2); - } - - template result_type operator()(A1 & a1, A2 const & a2) - { - return f_(a1, a2); - } - - template result_type operator()(A1 & a1, A2 const & a2) const - { - return f_(a1, a2); - } - - template result_type operator()(A1 const & a1, A2 const & a2) - { - return f_(a1, a2); - } - - template result_type operator()(A1 const & a1, A2 const & a2) const - { - return f_(a1, a2); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3) - { - return f_(a1, a2, a3); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3) const - { - return f_(a1, a2, a3); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) - { - return f_(a1, a2, a3); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) const - { - return f_(a1, a2, a3); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) - { - return f_(a1, a2, a3, a4); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const - { - return f_(a1, a2, a3, a4); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) - { - return f_(a1, a2, a3, a4); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) const - { - return f_(a1, a2, a3, a4); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) - { - return f_(a1, a2, a3, a4, a5); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const - { - return f_(a1, a2, a3, a4, a5); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) - { - return f_(a1, a2, a3, a4, a5); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) const - { - return f_(a1, a2, a3, a4, a5); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) - { - return f_(a1, a2, a3, a4, a5, a6); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const - { - return f_(a1, a2, a3, a4, a5, a6); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) - { - return f_(a1, a2, a3, a4, a5, a6); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) const - { - return f_(a1, a2, a3, a4, a5, a6); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) - { - return f_(a1, a2, a3, a4, a5, a6, a7); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const - { - return f_(a1, a2, a3, a4, a5, a6, a7); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) - { - return f_(a1, a2, a3, a4, a5, a6, a7); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) const - { - return f_(a1, a2, a3, a4, a5, a6, a7); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) - { - return f_(a1, a2, a3, a4, a5, a6, a7, a8); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const - { - return f_(a1, a2, a3, a4, a5, a6, a7, a8); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) - { - return f_(a1, a2, a3, a4, a5, a6, a7, a8); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) const - { - return f_(a1, a2, a3, a4, a5, a6, a7, a8); - } - -#endif - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) - { - return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9); - } - - template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const - { - return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9); - } - -#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) - { - return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9); - } - - template result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) const - { - return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9); - } - -#endif -}; - -#endif - } // namespace _bi template _bi::protected_bind_t protect(F f) diff --git a/highlight-wrapper/boost/bind/std_placeholders.hpp b/highlight-wrapper/boost/bind/std_placeholders.hpp index 125ff240..36cfed68 100644 --- a/highlight-wrapper/boost/bind/std_placeholders.hpp +++ b/highlight-wrapper/boost/bind/std_placeholders.hpp @@ -11,12 +11,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt -#include #include -#include - -#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) - #include #include @@ -35,6 +30,4 @@ template<> struct is_placeholder< typename std::decay= 1020) -# pragma once -#endif - -// -// bind/storage.hpp -// -// boost/bind.hpp support header, optimized storage -// -// Copyright (c) 2006 Peter Dimov -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt -// -// See http://www.boost.org/libs/bind/bind.html for documentation. -// - -#include -#include -#include - -#ifdef BOOST_MSVC -# pragma warning(push) -# pragma warning(disable: 4512) // assignment operator could not be generated -#endif - -namespace boost -{ - -namespace _bi -{ - -// 1 - -template struct storage1 -{ - explicit storage1( A1 a1 ): a1_( a1 ) {} - - template void accept(V & v) const - { - BOOST_BIND_VISIT_EACH(v, a1_, 0); - } - - A1 a1_; -}; - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_BORLANDC ) - -template struct storage1< boost::arg > -{ - explicit storage1( boost::arg ) {} - - template void accept(V &) const { } - - static boost::arg a1_() { return boost::arg(); } -}; - -template struct storage1< boost::arg (*) () > -{ - explicit storage1( boost::arg (*) () ) {} - - template void accept(V &) const { } - - static boost::arg a1_() { return boost::arg(); } -}; - -#endif - -// 2 - -template struct storage2: public storage1 -{ - typedef storage1 inherited; - - storage2( A1 a1, A2 a2 ): storage1( a1 ), a2_( a2 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - BOOST_BIND_VISIT_EACH(v, a2_, 0); - } - - A2 a2_; -}; - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - -template struct storage2< A1, boost::arg >: public storage1 -{ - typedef storage1 inherited; - - storage2( A1 a1, boost::arg ): storage1( a1 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a2_() { return boost::arg(); } -}; - -template struct storage2< A1, boost::arg (*) () >: public storage1 -{ - typedef storage1 inherited; - - storage2( A1 a1, boost::arg (*) () ): storage1( a1 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a2_() { return boost::arg(); } -}; - -#endif - -// 3 - -template struct storage3: public storage2< A1, A2 > -{ - typedef storage2 inherited; - - storage3( A1 a1, A2 a2, A3 a3 ): storage2( a1, a2 ), a3_( a3 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - BOOST_BIND_VISIT_EACH(v, a3_, 0); - } - - A3 a3_; -}; - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - -template struct storage3< A1, A2, boost::arg >: public storage2< A1, A2 > -{ - typedef storage2 inherited; - - storage3( A1 a1, A2 a2, boost::arg ): storage2( a1, a2 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a3_() { return boost::arg(); } -}; - -template struct storage3< A1, A2, boost::arg (*) () >: public storage2< A1, A2 > -{ - typedef storage2 inherited; - - storage3( A1 a1, A2 a2, boost::arg (*) () ): storage2( a1, a2 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a3_() { return boost::arg(); } -}; - -#endif - -// 4 - -template struct storage4: public storage3< A1, A2, A3 > -{ - typedef storage3 inherited; - - storage4( A1 a1, A2 a2, A3 a3, A4 a4 ): storage3( a1, a2, a3 ), a4_( a4 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - BOOST_BIND_VISIT_EACH(v, a4_, 0); - } - - A4 a4_; -}; - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - -template struct storage4< A1, A2, A3, boost::arg >: public storage3< A1, A2, A3 > -{ - typedef storage3 inherited; - - storage4( A1 a1, A2 a2, A3 a3, boost::arg ): storage3( a1, a2, a3 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a4_() { return boost::arg(); } -}; - -template struct storage4< A1, A2, A3, boost::arg (*) () >: public storage3< A1, A2, A3 > -{ - typedef storage3 inherited; - - storage4( A1 a1, A2 a2, A3 a3, boost::arg (*) () ): storage3( a1, a2, a3 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a4_() { return boost::arg(); } -}; - -#endif - -// 5 - -template struct storage5: public storage4< A1, A2, A3, A4 > -{ - typedef storage4 inherited; - - storage5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): storage4( a1, a2, a3, a4 ), a5_( a5 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - BOOST_BIND_VISIT_EACH(v, a5_, 0); - } - - A5 a5_; -}; - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - -template struct storage5< A1, A2, A3, A4, boost::arg >: public storage4< A1, A2, A3, A4 > -{ - typedef storage4 inherited; - - storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg ): storage4( a1, a2, a3, a4 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a5_() { return boost::arg(); } -}; - -template struct storage5< A1, A2, A3, A4, boost::arg (*) () >: public storage4< A1, A2, A3, A4 > -{ - typedef storage4 inherited; - - storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg (*) () ): storage4( a1, a2, a3, a4 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a5_() { return boost::arg(); } -}; - -#endif - -// 6 - -template struct storage6: public storage5< A1, A2, A3, A4, A5 > -{ - typedef storage5 inherited; - - storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): storage5( a1, a2, a3, a4, a5 ), a6_( a6 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - BOOST_BIND_VISIT_EACH(v, a6_, 0); - } - - A6 a6_; -}; - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - -template struct storage6< A1, A2, A3, A4, A5, boost::arg >: public storage5< A1, A2, A3, A4, A5 > -{ - typedef storage5 inherited; - - storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg ): storage5( a1, a2, a3, a4, a5 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a6_() { return boost::arg(); } -}; - -template struct storage6< A1, A2, A3, A4, A5, boost::arg (*) () >: public storage5< A1, A2, A3, A4, A5 > -{ - typedef storage5 inherited; - - storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg (*) () ): storage5( a1, a2, a3, a4, a5 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a6_() { return boost::arg(); } -}; - -#endif - -// 7 - -template struct storage7: public storage6< A1, A2, A3, A4, A5, A6 > -{ - typedef storage6 inherited; - - storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): storage6( a1, a2, a3, a4, a5, a6 ), a7_( a7 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - BOOST_BIND_VISIT_EACH(v, a7_, 0); - } - - A7 a7_; -}; - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - -template struct storage7< A1, A2, A3, A4, A5, A6, boost::arg >: public storage6< A1, A2, A3, A4, A5, A6 > -{ - typedef storage6 inherited; - - storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg ): storage6( a1, a2, a3, a4, a5, a6 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a7_() { return boost::arg(); } -}; - -template struct storage7< A1, A2, A3, A4, A5, A6, boost::arg (*) () >: public storage6< A1, A2, A3, A4, A5, A6 > -{ - typedef storage6 inherited; - - storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg (*) () ): storage6( a1, a2, a3, a4, a5, a6 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a7_() { return boost::arg(); } -}; - -#endif - -// 8 - -template struct storage8: public storage7< A1, A2, A3, A4, A5, A6, A7 > -{ - typedef storage7 inherited; - - storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): storage7( a1, a2, a3, a4, a5, a6, a7 ), a8_( a8 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - BOOST_BIND_VISIT_EACH(v, a8_, 0); - } - - A8 a8_; -}; - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - -template struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg >: public storage7< A1, A2, A3, A4, A5, A6, A7 > -{ - typedef storage7 inherited; - - storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg ): storage7( a1, a2, a3, a4, a5, a6, a7 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a8_() { return boost::arg(); } -}; - -template struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg (*) () >: public storage7< A1, A2, A3, A4, A5, A6, A7 > -{ - typedef storage7 inherited; - - storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg (*) () ): storage7( a1, a2, a3, a4, a5, a6, a7 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a8_() { return boost::arg(); } -}; - -#endif - -// 9 - -template struct storage9: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 > -{ - typedef storage8 inherited; - - storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): storage8( a1, a2, a3, a4, a5, a6, a7, a8 ), a9_( a9 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - BOOST_BIND_VISIT_EACH(v, a9_, 0); - } - - A9 a9_; -}; - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - -template struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 > -{ - typedef storage8 inherited; - - storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg ): storage8( a1, a2, a3, a4, a5, a6, a7, a8 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a9_() { return boost::arg(); } -}; - -template struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg (*) () >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 > -{ - typedef storage8 inherited; - - storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg (*) () ): storage8( a1, a2, a3, a4, a5, a6, a7, a8 ) {} - - template void accept(V & v) const - { - inherited::accept(v); - } - - static boost::arg a9_() { return boost::arg(); } -}; - -#endif - -} // namespace _bi - -} // namespace boost - -#ifdef BOOST_MSVC -# pragma warning(default: 4512) // assignment operator could not be generated -# pragma warning(pop) -#endif - -#endif // #ifndef BOOST_BIND_STORAGE_HPP_INCLUDED diff --git a/highlight-wrapper/boost/config/compiler/borland.hpp b/highlight-wrapper/boost/config/compiler/borland.hpp index 567636c5..51d51886 100644 --- a/highlight-wrapper/boost/config/compiler/borland.hpp +++ b/highlight-wrapper/boost/config/compiler/borland.hpp @@ -245,6 +245,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #if __BORLANDC__ >= 0x590 # define BOOST_HAS_TR1_HASH diff --git a/highlight-wrapper/boost/config/compiler/clang.hpp b/highlight-wrapper/boost/config/compiler/clang.hpp index 1eeed315..f9a5050b 100644 --- a/highlight-wrapper/boost/config/compiler/clang.hpp +++ b/highlight-wrapper/boost/config/compiler/clang.hpp @@ -321,6 +321,10 @@ # define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif +#if (__clang_major__ < 4) || (__cplusplus < 201406L) /* non-standard value that is greater than 201402, which is reported by clang 4.0.0 for C++1z */ +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif + #if __cplusplus < 201103L #define BOOST_NO_CXX11_SFINAE_EXPR #endif diff --git a/highlight-wrapper/boost/config/compiler/clang_version.hpp b/highlight-wrapper/boost/config/compiler/clang_version.hpp index 70c5507c..a61de13d 100644 --- a/highlight-wrapper/boost/config/compiler/clang_version.hpp +++ b/highlight-wrapper/boost/config/compiler/clang_version.hpp @@ -2,7 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt) -#if !defined(__APPLE__) +#if !defined(__apple_build_version__) # define BOOST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__ % 100) @@ -11,7 +11,13 @@ // https://en.wikipedia.org/wiki/Xcode#Toolchain_versions -# if BOOST_CLANG_REPORTED_VERSION >= 140000 +# if BOOST_CLANG_REPORTED_VERSION >= 150000 +# define BOOST_CLANG_VERSION 160000 + +# elif BOOST_CLANG_REPORTED_VERSION >= 140003 +# define BOOST_CLANG_VERSION 150000 + +# elif BOOST_CLANG_REPORTED_VERSION >= 140000 # define BOOST_CLANG_VERSION 140000 # elif BOOST_CLANG_REPORTED_VERSION >= 130100 diff --git a/highlight-wrapper/boost/config/compiler/codegear.hpp b/highlight-wrapper/boost/config/compiler/codegear.hpp index 4d3f42ae..49f934c0 100644 --- a/highlight-wrapper/boost/config/compiler/codegear.hpp +++ b/highlight-wrapper/boost/config/compiler/codegear.hpp @@ -316,6 +316,10 @@ # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif + // // TR1 macros: // diff --git a/highlight-wrapper/boost/config/compiler/common_edg.hpp b/highlight-wrapper/boost/config/compiler/common_edg.hpp index dc049893..0d59ae0e 100644 --- a/highlight-wrapper/boost/config/compiler/common_edg.hpp +++ b/highlight-wrapper/boost/config/compiler/common_edg.hpp @@ -171,10 +171,12 @@ #if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) # define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif - #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #ifdef c_plusplus // EDG has "long long" in non-strict mode diff --git a/highlight-wrapper/boost/config/compiler/digitalmars.hpp b/highlight-wrapper/boost/config/compiler/digitalmars.hpp index bb56ff6c..4fa347ab 100644 --- a/highlight-wrapper/boost/config/compiler/digitalmars.hpp +++ b/highlight-wrapper/boost/config/compiler/digitalmars.hpp @@ -130,6 +130,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #if (__DMC__ <= 0x840) #error "Compiler not supported or configured - please reconfigure" diff --git a/highlight-wrapper/boost/config/compiler/gcc.hpp b/highlight-wrapper/boost/config/compiler/gcc.hpp index 2f1fe550..fc05a918 100644 --- a/highlight-wrapper/boost/config/compiler/gcc.hpp +++ b/highlight-wrapper/boost/config/compiler/gcc.hpp @@ -319,6 +319,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if (__GNUC__ < 7) || (__cplusplus < 201703L) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #if __GNUC__ >= 7 # define BOOST_FALLTHROUGH __attribute__((fallthrough)) diff --git a/highlight-wrapper/boost/config/compiler/gcc_xml.hpp b/highlight-wrapper/boost/config/compiler/gcc_xml.hpp index 75cac44e..e23b14d0 100644 --- a/highlight-wrapper/boost/config/compiler/gcc_xml.hpp +++ b/highlight-wrapper/boost/config/compiler/gcc_xml.hpp @@ -108,7 +108,8 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__ - - diff --git a/highlight-wrapper/boost/config/compiler/hp_acc.hpp b/highlight-wrapper/boost/config/compiler/hp_acc.hpp index 25636324..42e35e55 100644 --- a/highlight-wrapper/boost/config/compiler/hp_acc.hpp +++ b/highlight-wrapper/boost/config/compiler/hp_acc.hpp @@ -137,6 +137,10 @@ #define BOOST_NO_CXX11_VARIADIC_MACROS #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif + #endif // diff --git a/highlight-wrapper/boost/config/compiler/metrowerks.hpp b/highlight-wrapper/boost/config/compiler/metrowerks.hpp index 448ab67b..c38efb32 100644 --- a/highlight-wrapper/boost/config/compiler/metrowerks.hpp +++ b/highlight-wrapper/boost/config/compiler/metrowerks.hpp @@ -173,6 +173,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) diff --git a/highlight-wrapper/boost/config/compiler/mpw.hpp b/highlight-wrapper/boost/config/compiler/mpw.hpp index 8433f371..3adb6122 100644 --- a/highlight-wrapper/boost/config/compiler/mpw.hpp +++ b/highlight-wrapper/boost/config/compiler/mpw.hpp @@ -122,6 +122,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif // // versions check: diff --git a/highlight-wrapper/boost/config/compiler/nvcc.hpp b/highlight-wrapper/boost/config/compiler/nvcc.hpp index 419dd724..147f75db 100644 --- a/highlight-wrapper/boost/config/compiler/nvcc.hpp +++ b/highlight-wrapper/boost/config/compiler/nvcc.hpp @@ -57,5 +57,8 @@ # define BOOST_NO_CXX11_NOEXCEPT #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS #endif +#endif diff --git a/highlight-wrapper/boost/config/compiler/pathscale.hpp b/highlight-wrapper/boost/config/compiler/pathscale.hpp index 5348cf7f..59ab9b00 100644 --- a/highlight-wrapper/boost/config/compiler/pathscale.hpp +++ b/highlight-wrapper/boost/config/compiler/pathscale.hpp @@ -135,4 +135,7 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif #endif diff --git a/highlight-wrapper/boost/config/compiler/sunpro_cc.hpp b/highlight-wrapper/boost/config/compiler/sunpro_cc.hpp index 490dc76d..334b604b 100644 --- a/highlight-wrapper/boost/config/compiler/sunpro_cc.hpp +++ b/highlight-wrapper/boost/config/compiler/sunpro_cc.hpp @@ -194,6 +194,9 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif // Turn on threading support for Solaris 12. // Ticket #11972 diff --git a/highlight-wrapper/boost/config/compiler/vacpp.hpp b/highlight-wrapper/boost/config/compiler/vacpp.hpp index 9cfa1adf..3794d360 100644 --- a/highlight-wrapper/boost/config/compiler/vacpp.hpp +++ b/highlight-wrapper/boost/config/compiler/vacpp.hpp @@ -184,3 +184,6 @@ #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) # define BOOST_NO_CXX17_IF_CONSTEXPR #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif diff --git a/highlight-wrapper/boost/config/compiler/visualc.hpp b/highlight-wrapper/boost/config/compiler/visualc.hpp index ae631219..ce0fc15e 100644 --- a/highlight-wrapper/boost/config/compiler/visualc.hpp +++ b/highlight-wrapper/boost/config/compiler/visualc.hpp @@ -263,6 +263,9 @@ #define BOOST_NO_CXX17_INLINE_VARIABLES #define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif +#if (_MSC_VER < 1914) || (_MSVC_LANG < 201703) +#define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif // // Things that don't work in clr mode: @@ -305,6 +308,10 @@ # define BOOST_CXX_VERSION 201402L #endif +#if BOOST_CXX_VERSION >= 201703L +# define BOOST_ATTRIBUTE_UNUSED [[maybe_unused]] +#endif + #ifndef BOOST_COMPILER // TODO: // these things are mostly bogus. 1200 means version 12.0 of the compiler. The diff --git a/highlight-wrapper/boost/config/compiler/xlcpp.hpp b/highlight-wrapper/boost/config/compiler/xlcpp.hpp index 99b8b245..4a4477d9 100644 --- a/highlight-wrapper/boost/config/compiler/xlcpp.hpp +++ b/highlight-wrapper/boost/config/compiler/xlcpp.hpp @@ -265,6 +265,10 @@ # define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif +#if !defined(__cpp_nontype_template_parameter_auto) || (__cpp_nontype_template_parameter_auto < 201606) +# define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS +#endif + #if !__has_feature(cxx_thread_local) # define BOOST_NO_CXX11_THREAD_LOCAL #endif diff --git a/highlight-wrapper/boost/config/compiler/xlcpp_zos.hpp b/highlight-wrapper/boost/config/compiler/xlcpp_zos.hpp index 9a177f1b..0b288a88 100644 --- a/highlight-wrapper/boost/config/compiler/xlcpp_zos.hpp +++ b/highlight-wrapper/boost/config/compiler/xlcpp_zos.hpp @@ -157,6 +157,7 @@ #define BOOST_NO_CXX17_INLINE_VARIABLES #define BOOST_NO_CXX17_FOLD_EXPRESSIONS #define BOOST_NO_CXX17_IF_CONSTEXPR +#define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS // ------------------------------------- diff --git a/highlight-wrapper/boost/config/detail/cxx_composite.hpp b/highlight-wrapper/boost/config/detail/cxx_composite.hpp index a243d41f..acd8e849 100644 --- a/highlight-wrapper/boost/config/detail/cxx_composite.hpp +++ b/highlight-wrapper/boost/config/detail/cxx_composite.hpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Sun Jun 5 16:50:18 2022 +// This file was automatically generated on Fri Oct 13 19:09:38 2023 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-21. // Use, modification and distribution are subject to the @@ -81,6 +81,7 @@ #if defined(BOOST_NO_CXX03)\ || defined(BOOST_NO_CXX11_ADDRESSOF)\ || defined(BOOST_NO_CXX11_ALIGNAS)\ + || defined(BOOST_NO_CXX11_ALIGNOF)\ || defined(BOOST_NO_CXX11_ALLOCATOR)\ || defined(BOOST_NO_CXX11_AUTO_DECLARATIONS)\ || defined(BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS)\ @@ -163,6 +164,7 @@ #endif #if defined(BOOST_NO_CXX14)\ + || defined(BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS)\ || defined(BOOST_NO_CXX17_DEDUCTION_GUIDES)\ || defined(BOOST_NO_CXX17_FOLD_EXPRESSIONS)\ || defined(BOOST_NO_CXX17_HDR_ANY)\ @@ -201,3 +203,16 @@ # define BOOST_NO_CXX20 #endif +#if defined(BOOST_NO_CXX20)\ + || defined(BOOST_NO_CXX23_HDR_EXPECTED)\ + || defined(BOOST_NO_CXX23_HDR_FLAT_MAP)\ + || defined(BOOST_NO_CXX23_HDR_FLAT_SET)\ + || defined(BOOST_NO_CXX23_HDR_GENERATOR)\ + || defined(BOOST_NO_CXX23_HDR_MDSPAN)\ + || defined(BOOST_NO_CXX23_HDR_PRINT)\ + || defined(BOOST_NO_CXX23_HDR_SPANSTREAM)\ + || defined(BOOST_NO_CXX23_HDR_STACKTRACE)\ + || defined(BOOST_NO_CXX23_HDR_STDFLOAT) +# define BOOST_NO_CXX23 +#endif + diff --git a/highlight-wrapper/boost/config/detail/suffix.hpp b/highlight-wrapper/boost/config/detail/suffix.hpp index b28d46f1..2650510f 100644 --- a/highlight-wrapper/boost/config/detail/suffix.hpp +++ b/highlight-wrapper/boost/config/detail/suffix.hpp @@ -1257,6 +1257,46 @@ namespace std{ using ::type_info; } #endif #endif +#if (!defined(__has_include) || (BOOST_CXX_VERSION < 202003L)) +# define BOOST_NO_CXX23_HDR_EXPECTED +# define BOOST_NO_CXX23_HDR_FLAT_MAP +# define BOOST_NO_CXX23_HDR_FLAT_SET +# define BOOST_NO_CXX23_HDR_GENERATOR +# define BOOST_NO_CXX23_HDR_MDSPAN +# define BOOST_NO_CXX23_HDR_PRINT +# define BOOST_NO_CXX23_HDR_SPANSTREAM +# define BOOST_NO_CXX23_HDR_STACKTRACE +# define BOOST_NO_CXX23_HDR_STDFLOAT +#else +#if (!__has_include() || !defined(__cpp_lib_expected) || (__cpp_lib_expected < 202211L)) && !defined(BOOST_NO_CXX23_HDR_EXPECTED) +# define BOOST_NO_CXX23_HDR_EXPECTED +#endif +#if (!__has_include() || !defined(__cpp_lib_flat_map) || (__cpp_lib_flat_map < 202207L)) && !defined(BOOST_NO_CXX23_HDR_FLAT_MAP) +# define BOOST_NO_CXX23_HDR_FLAT_MAP +#endif +#if (!__has_include() || !defined(__cpp_lib_flat_set) || (__cpp_lib_flat_set < 202207L)) && !defined(BOOST_NO_CXX23_HDR_FLAT_SET) +# define BOOST_NO_CXX23_HDR_FLAT_SET +#endif +#if (!__has_include() || !defined(__cpp_lib_generator) || (__cpp_lib_generator < 202207L)) && !defined(BOOST_NO_CXX23_HDR_GENERATOR) +# define BOOST_NO_CXX23_HDR_GENERATOR +#endif +#if (!__has_include() || !defined(__cpp_lib_mdspan) || (__cpp_lib_mdspan < 202207L)) && !defined(BOOST_NO_CXX23_HDR_MDSPAN) +# define BOOST_NO_CXX23_HDR_MDSPAN +#endif +#if (!__has_include() || !defined(__cpp_lib_print) || (__cpp_lib_print < 202207L)) && !defined(BOOST_NO_CXX23_HDR_PRINT) +# define BOOST_NO_CXX23_HDR_PRINT +#endif +#if (!__has_include() || !defined(__cpp_lib_spanstream) || (__cpp_lib_spanstream < 202106L)) && !defined(BOOST_NO_CXX23_HDR_SPANSTREAM) +# define BOOST_NO_CXX23_HDR_SPANSTREAM +#endif +#if (!__has_include() || !defined(__cpp_lib_stacktrace) || (__cpp_lib_stacktrace < 202011L)) && !defined(BOOST_NO_CXX23_HDR_STACKTRACE) +# define BOOST_NO_CXX23_HDR_STACKTRACE +#endif +#if !__has_include() && !defined(BOOST_NO_CXX23_HDR_STDFLOAT) +# define BOOST_NO_CXX23_HDR_STDFLOAT +#endif +#endif + #if defined(__cplusplus) && defined(__has_include) #if !__has_include() # define BOOST_NO_CXX20_HDR_VERSION diff --git a/highlight-wrapper/boost/container/adaptive_pool.hpp b/highlight-wrapper/boost/container/adaptive_pool.hpp index fb0e24b0..a6a89fa5 100644 --- a/highlight-wrapper/boost/container/adaptive_pool.hpp +++ b/highlight-wrapper/boost/container/adaptive_pool.hpp @@ -34,7 +34,6 @@ #include #include -#include #include #include @@ -72,12 +71,12 @@ class adaptive_pool BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I Version) > self_t; - static const std::size_t nodes_per_block = NodesPerBlock; - static const std::size_t max_free_blocks = MaxFreeBlocks; - static const std::size_t overhead_percent = OverheadPercent; - static const std::size_t real_nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t max_free_blocks = MaxFreeBlocks; + BOOST_STATIC_CONSTEXPR std::size_t overhead_percent = OverheadPercent; + BOOST_STATIC_CONSTEXPR std::size_t real_nodes_per_block = NodesPerBlock; - BOOST_CONTAINER_DOCIGN(BOOST_STATIC_ASSERT((Version <=2))); + BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_STATIC_ASSERT((Version <=2))); public: //------- @@ -254,7 +253,7 @@ class adaptive_pool //!Elements must be individually deallocated with deallocate() void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain) { - BOOST_STATIC_ASSERT(( Version > 1 ));/* + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 ));/* dlmalloc_memchain ch; BOOST_CONTAINER_MEMCHAIN_INIT(&ch); if(BOOST_UNLIKELY(!dlmalloc_multialloc_nodes(n_elements, elem_size*sizeof(T), BOOST_CONTAINER_DL_MULTIALLOC_DEFAULT_CONTIGUOUS, &ch))){ @@ -275,7 +274,7 @@ class adaptive_pool //!Elements must be individually deallocated with deallocate() void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain) { - BOOST_STATIC_ASSERT(( Version > 1 ));/* + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 ));/* dlmalloc_memchain ch; BOOST_CONTAINER_MEMCHAIN_INIT(&ch); if(BOOST_UNLIKELY(!dlmalloc_multialloc_arrays(n_elements, elem_sizes, sizeof(T), BOOST_CONTAINER_DL_MULTIALLOC_DEFAULT_CONTIGUOUS, &ch))){ @@ -385,12 +384,12 @@ class private_adaptive_pool BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I Version) > self_t; - static const std::size_t nodes_per_block = NodesPerBlock; - static const std::size_t max_free_blocks = MaxFreeBlocks; - static const std::size_t overhead_percent = OverheadPercent; - static const std::size_t real_nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t max_free_blocks = MaxFreeBlocks; + BOOST_STATIC_CONSTEXPR std::size_t overhead_percent = OverheadPercent; + BOOST_STATIC_CONSTEXPR std::size_t real_nodes_per_block = NodesPerBlock; - BOOST_CONTAINER_DOCIGN(BOOST_STATIC_ASSERT((Version <=2))); + BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_STATIC_ASSERT((Version <=2))); typedef dtl::private_adaptive_node_pool pool_t; @@ -546,7 +545,7 @@ class private_adaptive_pool //!Elements must be individually deallocated with deallocate() void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain) { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); if(BOOST_UNLIKELY(!dlmalloc_multialloc_nodes ( n_elements, elem_size*sizeof(T), BOOST_CONTAINER_DL_MULTIALLOC_DEFAULT_CONTIGUOUS , move_detail::force_ptr(&chain)))){ @@ -558,7 +557,7 @@ class private_adaptive_pool //!Elements must be individually deallocated with deallocate() void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain) { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); if(BOOST_UNLIKELY(!dlmalloc_multialloc_arrays (n_elements, elem_sizes, sizeof(T), BOOST_CONTAINER_DL_MULTIALLOC_DEFAULT_CONTIGUOUS , move_detail::force_ptr(&chain)))){ diff --git a/highlight-wrapper/boost/container/allocator.hpp b/highlight-wrapper/boost/container/allocator.hpp index b245c6f4..3d82f71d 100644 --- a/highlight-wrapper/boost/container/allocator.hpp +++ b/highlight-wrapper/boost/container/allocator.hpp @@ -26,7 +26,6 @@ #include #include #include -#include #include @@ -116,14 +115,14 @@ class allocator template allocator& operator=(const allocator&); - static const unsigned int ForbiddenMask = + BOOST_STATIC_CONSTEXPR unsigned int ForbiddenMask = BOOST_CONTAINER_ALLOCATE_NEW | BOOST_CONTAINER_EXPAND_BWD | BOOST_CONTAINER_EXPAND_FWD ; //The mask can't disable all the allocation types - BOOST_STATIC_ASSERT(( (AllocationDisableMask & ForbiddenMask) != ForbiddenMask )); + BOOST_CONTAINER_STATIC_ASSERT(( (AllocationDisableMask & ForbiddenMask) != ForbiddenMask )); //The mask is only valid for version 2 allocators - BOOST_STATIC_ASSERT(( Version != 1 || (AllocationDisableMask == 0) )); + BOOST_CONTAINER_STATIC_ASSERT(( Version != 1 || (AllocationDisableMask == 0) )); #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -193,17 +192,17 @@ class allocator //!Deallocates previously allocated memory. //!Never throws - BOOST_CONTAINER_FORCEINLINE void deallocate(pointer ptr, size_type) BOOST_NOEXCEPT_OR_NOTHROW + inline void deallocate(pointer ptr, size_type) BOOST_NOEXCEPT_OR_NOTHROW { dlmalloc_free(ptr); } //!Returns the maximum number of elements that could be allocated. //!Never throws - BOOST_CONTAINER_FORCEINLINE size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW + inline size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW { return size_type(-1)/(2u*sizeof(T)); } //!Swaps two allocators, does nothing //!because this allocator is stateless - BOOST_CONTAINER_FORCEINLINE friend void swap(self_t &, self_t &) BOOST_NOEXCEPT_OR_NOTHROW + inline friend void swap(self_t &, self_t &) BOOST_NOEXCEPT_OR_NOTHROW {} //!An allocator always compares to true, as memory allocated with one @@ -214,7 +213,7 @@ class allocator //!An allocator always compares to false, as memory allocated with one //!instance can be deallocated by another instance - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator!=(const allocator &, const allocator &) BOOST_NOEXCEPT_OR_NOTHROW { return false; } @@ -227,7 +226,7 @@ class allocator size_type &prefer_in_recvd_out_size, pointer &reuse) { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); const allocation_type mask(AllocationDisableMask); command &= ~mask; pointer ret = this->priv_allocation_command(command, limit_size, prefer_in_recvd_out_size, reuse); @@ -243,7 +242,7 @@ class allocator //!This function is available only with Version == 2 BOOST_CONTAINER_ATTRIBUTE_NODISCARD size_type size(pointer p) const BOOST_NOEXCEPT_OR_NOTHROW { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); return dlmalloc_size(p); } @@ -251,18 +250,18 @@ class allocator //!must be deallocated only with deallocate_one(). //!Throws bad_alloc if there is no enough memory //!This function is available only with Version == 2 - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE pointer allocate_one() + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline pointer allocate_one() { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); return this->allocate(1); } //!Allocates many elements of size == 1. //!Elements must be individually deallocated with deallocate_one() //!This function is available only with Version == 2 - BOOST_CONTAINER_FORCEINLINE void allocate_individual(std::size_t num_elements, multiallocation_chain &chain) + inline void allocate_individual(std::size_t num_elements, multiallocation_chain &chain) { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); this->allocate_many(1, num_elements, chain); } @@ -272,16 +271,16 @@ class allocator //Never throws void deallocate_one(pointer p) BOOST_NOEXCEPT_OR_NOTHROW { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); return this->deallocate(p, 1); } //!Deallocates memory allocated with allocate_one() or allocate_individual(). //!This function is available only with Version == 2 - BOOST_CONTAINER_FORCEINLINE + inline void deallocate_individual(multiallocation_chain &chain) BOOST_NOEXCEPT_OR_NOTHROW { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); return this->deallocate_many(chain); } @@ -290,7 +289,7 @@ class allocator //!This function is available only with Version == 2 void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain) { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); dlmalloc_memchain ch; BOOST_CONTAINER_MEMCHAIN_INIT(&ch); if(!dlmalloc_multialloc_nodes(n_elements, elem_size*sizeof(T), BOOST_CONTAINER_DL_MULTIALLOC_DEFAULT_CONTIGUOUS, &ch)){ @@ -312,7 +311,7 @@ class allocator //!This function is available only with Version == 2 void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain) { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); dlmalloc_memchain ch; BOOST_CONTAINER_MEMCHAIN_INIT(&ch); if(!dlmalloc_multialloc_arrays(n_elements, elem_sizes, sizeof(T), BOOST_CONTAINER_DL_MULTIALLOC_DEFAULT_CONTIGUOUS, &ch)){ @@ -334,11 +333,11 @@ class allocator //!This function is available only with Version == 2 void deallocate_many(multiallocation_chain &chain) BOOST_NOEXCEPT_OR_NOTHROW { - BOOST_STATIC_ASSERT(( Version > 1 )); + BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 )); dlmalloc_memchain ch; void *beg(&*chain.begin()), *last(&*chain.last()); - size_t size(chain.size()); - BOOST_CONTAINER_MEMCHAIN_INIT_FROM(&ch, beg, last, size); + size_t sz(chain.size()); + BOOST_CONTAINER_MEMCHAIN_INIT_FROM(&ch, beg, last, sz); dlmalloc_multidealloc(&ch); //dlmalloc_multidealloc(move_detail::force_ptr(&chain)); } diff --git a/highlight-wrapper/boost/container/allocator_traits.hpp b/highlight-wrapper/boost/container/allocator_traits.hpp index f5f73efa..dd5bf0e4 100644 --- a/highlight-wrapper/boost/container/allocator_traits.hpp +++ b/highlight-wrapper/boost/container/allocator_traits.hpp @@ -32,6 +32,8 @@ #include #include //is_empty #include +#include +#include #ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP #include #endif @@ -44,14 +46,13 @@ #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) #include #endif -// other boost -#include #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED -#if defined(BOOST_GCC) && (BOOST_GCC >= 40600) +#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME allocate @@ -75,7 +76,7 @@ #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 9 #include -#if defined(BOOST_GCC) && (BOOST_GCC >= 40600) +#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED) #pragma GCC diagnostic pop #endif @@ -83,6 +84,144 @@ namespace boost { namespace container { +namespace dtl { + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + +template +BOOST_CONTAINER_FORCEINLINE void construct_type(T *p, BOOST_FWD_REF(Args) ...args) +{ + ::new((void*)p, boost_container_new_t()) T(::boost::forward(args)...); +} + +template < class Pair, class KeyType, class ... Args> +typename dtl::enable_if< dtl::is_pair, void >::type +construct_type + (Pair* p, try_emplace_t, BOOST_FWD_REF(KeyType) k, BOOST_FWD_REF(Args) ...args) +{ + construct_type(dtl::addressof(p->first), ::boost::forward(k)); + BOOST_CONTAINER_TRY{ + construct_type(dtl::addressof(p->second), ::boost::forward(args)...); + } + BOOST_CONTAINER_CATCH(...) { + typedef typename Pair::first_type first_type; + dtl::addressof(p->first)->~first_type(); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END +} + +#else + +#define BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ(N) \ +template\ +BOOST_CONTAINER_FORCEINLINE \ + typename dtl::disable_if_c::value, void >::type \ +construct_type(T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ +{\ + ::new((void*)p, boost_container_new_t()) T( BOOST_MOVE_FWD##N );\ +}\ +// +BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ) +#undef BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPEJ + +#define BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE(N) \ +template < class Pair, class KeyType BOOST_MOVE_I##N BOOST_MOVE_CLASS##N>\ +typename dtl::enable_if< dtl::is_pair, void >::type construct_type\ + (Pair* p, try_emplace_t, BOOST_FWD_REF(KeyType) k BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ +{\ + construct_type(dtl::addressof(p->first), ::boost::forward(k));\ + BOOST_CONTAINER_TRY{\ + construct_type(dtl::addressof(p->second) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\ + }\ + BOOST_CONTAINER_CATCH(...) {\ + typedef typename Pair::first_type first_type;\ + dtl::addressof(p->first)->~first_type();\ + BOOST_CONTAINER_RETHROW\ + }\ + BOOST_CONTAINER_CATCH_END\ +}\ +// +BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE) +#undef BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_TYPE + +#endif + +template +inline +typename dtl::enable_if, void >::type +construct_type(T* p) +{ + dtl::construct_type(dtl::addressof(p->first)); + BOOST_CONTAINER_TRY{ + dtl::construct_type(dtl::addressof(p->second)); + } + BOOST_CONTAINER_CATCH(...) { + typedef typename T::first_type first_type; + dtl::addressof(p->first)->~first_type(); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END +} + + +template +inline +typename dtl::enable_if_c + < dtl::is_pair::value + , void >::type +construct_type(T* p, U &u) +{ + dtl::construct_type(dtl::addressof(p->first), u.first); + BOOST_CONTAINER_TRY{ + dtl::construct_type(dtl::addressof(p->second), u.second); + } + BOOST_CONTAINER_CATCH(...) { + typedef typename T::first_type first_type; + dtl::addressof(p->first)->~first_type(); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END +} + +template +inline +typename dtl::enable_if_c + < dtl::is_pair::type>::value && + !boost::move_detail::is_reference::value //This is needed for MSVC10 and ambiguous overloads + , void >::type +construct_type(T* p, BOOST_RV_REF(U) u) +{ + dtl::construct_type(dtl::addressof(p->first), ::boost::move(u.first)); + BOOST_CONTAINER_TRY{ + dtl::construct_type(dtl::addressof(p->second), ::boost::move(u.second)); + } + BOOST_CONTAINER_CATCH(...) { + typedef typename T::first_type first_type; + dtl::addressof(p->first)->~first_type(); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END +} + +template +inline +typename dtl::enable_if, void >::type +construct_type(T* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y) +{ + dtl::construct_type(dtl::addressof(p->first), ::boost::forward(x)); + BOOST_CONTAINER_TRY{ + dtl::construct_type(dtl::addressof(p->second), ::boost::forward(y)); + } + BOOST_CONTAINER_CATCH(...) { + typedef typename T::first_type first_type; + dtl::addressof(p->first)->~first_type(); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END +} + +} //namespace dtl #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -102,19 +241,19 @@ namespace dtl { //supporting rvalue references template struct is_std_allocator -{ static const bool value = false; }; +{ BOOST_STATIC_CONSTEXPR bool value = false; }; template struct is_std_allocator< std::allocator > -{ static const bool value = true; }; +{ BOOST_STATIC_CONSTEXPR bool value = true; }; template struct is_std_allocator< small_vector_allocator, Options > > -{ static const bool value = true; }; +{ BOOST_STATIC_CONSTEXPR bool value = true; }; template struct is_not_std_allocator -{ static const bool value = !is_std_allocator::value; }; +{ BOOST_STATIC_CONSTEXPR bool value = !is_std_allocator::value; }; BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(pointer) BOOST_INTRUSIVE_INSTANTIATE_EVAL_DEFAULT_TYPE_TMPLT(const_pointer) @@ -298,18 +437,18 @@ struct allocator_traits //! Returns: a.allocate(n) //! - BOOST_CONTAINER_FORCEINLINE static pointer allocate(Allocator &a, size_type n) + inline static pointer allocate(Allocator &a, size_type n) { return a.allocate(n); } //! Returns: a.deallocate(p, n) //! //! Throws: Nothing - BOOST_CONTAINER_FORCEINLINE static void deallocate(Allocator &a, pointer p, size_type n) + inline static void deallocate(Allocator &a, pointer p, size_type n) { a.deallocate(p, n); } //! Effects: calls a.allocate(n, p) if that call is well-formed; //! otherwise, invokes a.allocate(n) - BOOST_CONTAINER_FORCEINLINE static pointer allocate(Allocator &a, size_type n, const_void_pointer p) + inline static pointer allocate(Allocator &a, size_type n, const_void_pointer p) { const bool value = boost::container::dtl:: has_member_function_callable_with_allocate @@ -321,7 +460,7 @@ struct allocator_traits //! Effects: calls a.destroy(p) if that call is well-formed; //! otherwise, invokes p->~T(). template - BOOST_CONTAINER_FORCEINLINE static void destroy(Allocator &a, T*p) BOOST_NOEXCEPT_OR_NOTHROW + inline static void destroy(Allocator &a, T*p) BOOST_NOEXCEPT_OR_NOTHROW { typedef T* destroy_pointer; const bool value = boost::container::dtl:: @@ -333,7 +472,7 @@ struct allocator_traits //! Returns: a.max_size() if that expression is well-formed; otherwise, //! numeric_limits::max(). - BOOST_CONTAINER_FORCEINLINE static size_type max_size(const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW + inline static size_type max_size(const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW { const bool value = allocator_traits_detail::has_max_size::value; dtl::bool_ flag; @@ -342,7 +481,7 @@ struct allocator_traits //! Returns: a.select_on_container_copy_construction() if that expression is well-formed; //! otherwise, a. - BOOST_CONTAINER_FORCEINLINE static BOOST_CONTAINER_DOC1ST(Allocator, + inline static BOOST_CONTAINER_DOC1ST(Allocator, typename dtl::if_c < allocator_traits_detail::has_select_on_container_copy_construction::value BOOST_MOVE_I Allocator BOOST_MOVE_I const Allocator & >::type) @@ -358,9 +497,9 @@ struct allocator_traits //! Effects: calls a.construct(p, std::forward(args)...) if that call is well-formed; //! otherwise, invokes `placement new` (static_cast(p)) T(std::forward(args)...) template - BOOST_CONTAINER_FORCEINLINE static void construct(Allocator & a, T* p, BOOST_FWD_REF(Args)... args) + inline static void construct(Allocator & a, T* p, BOOST_FWD_REF(Args)... args) { - static const bool value = ::boost::move_detail::and_ + BOOST_STATIC_CONSTEXPR bool value = ::boost::move_detail::and_ < dtl::is_not_std_allocator , boost::container::dtl::has_member_function_callable_with_construct < Allocator, T*, Args... > @@ -372,7 +511,7 @@ struct allocator_traits //! Returns: a.storage_is_unpropagable(p) if is_partially_propagable::value is true; otherwise, //! false. - BOOST_CONTAINER_FORCEINLINE static bool storage_is_unpropagable(const Allocator &a, pointer p) BOOST_NOEXCEPT_OR_NOTHROW + inline static bool storage_is_unpropagable(const Allocator &a, pointer p) BOOST_NOEXCEPT_OR_NOTHROW { dtl::bool_ flag; return allocator_traits::priv_storage_is_unpropagable(flag, a, p); @@ -380,7 +519,7 @@ struct allocator_traits //! Returns: true if is_always_equal::value == true, otherwise, //! a == b. - BOOST_CONTAINER_FORCEINLINE static bool equal(const Allocator &a, const Allocator &b) BOOST_NOEXCEPT_OR_NOTHROW + inline static bool equal(const Allocator &a, const Allocator &b) BOOST_NOEXCEPT_OR_NOTHROW { dtl::bool_ flag; return allocator_traits::priv_equal(flag, a, b); @@ -388,48 +527,48 @@ struct allocator_traits #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED) private: - BOOST_CONTAINER_FORCEINLINE static pointer priv_allocate(dtl::true_type, Allocator &a, size_type n, const_void_pointer p) + inline static pointer priv_allocate(dtl::true_type, Allocator &a, size_type n, const_void_pointer p) { return a.allocate(n, p); } - BOOST_CONTAINER_FORCEINLINE static pointer priv_allocate(dtl::false_type, Allocator &a, size_type n, const_void_pointer) + inline static pointer priv_allocate(dtl::false_type, Allocator &a, size_type n, const_void_pointer) { return a.allocate(n); } template - BOOST_CONTAINER_FORCEINLINE static void priv_destroy(dtl::true_type, Allocator &a, T* p) BOOST_NOEXCEPT_OR_NOTHROW + inline static void priv_destroy(dtl::true_type, Allocator &a, T* p) BOOST_NOEXCEPT_OR_NOTHROW { a.destroy(p); } template - BOOST_CONTAINER_FORCEINLINE static void priv_destroy(dtl::false_type, Allocator &, T* p) BOOST_NOEXCEPT_OR_NOTHROW + inline static void priv_destroy(dtl::false_type, Allocator &, T* p) BOOST_NOEXCEPT_OR_NOTHROW { p->~T(); (void)p; } - BOOST_CONTAINER_FORCEINLINE static size_type priv_max_size(dtl::true_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW + inline static size_type priv_max_size(dtl::true_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW { return a.max_size(); } - BOOST_CONTAINER_FORCEINLINE static size_type priv_max_size(dtl::false_type, const Allocator &) BOOST_NOEXCEPT_OR_NOTHROW + inline static size_type priv_max_size(dtl::false_type, const Allocator &) BOOST_NOEXCEPT_OR_NOTHROW { return size_type(-1)/sizeof(value_type); } - BOOST_CONTAINER_FORCEINLINE static Allocator priv_select_on_container_copy_construction(dtl::true_type, const Allocator &a) + inline static Allocator priv_select_on_container_copy_construction(dtl::true_type, const Allocator &a) { return a.select_on_container_copy_construction(); } - BOOST_CONTAINER_FORCEINLINE static const Allocator &priv_select_on_container_copy_construction(dtl::false_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW + inline static const Allocator &priv_select_on_container_copy_construction(dtl::false_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW { return a; } #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template - BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::true_type, Allocator &a, T *p, BOOST_FWD_REF(Args) ...args) + inline static void priv_construct(dtl::true_type, Allocator &a, T *p, BOOST_FWD_REF(Args) ...args) { a.construct( p, ::boost::forward(args)...); } template - BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::false_type, Allocator &, T *p, BOOST_FWD_REF(Args) ...args) - { ::new((void*)p, boost_container_new_t()) T(::boost::forward(args)...); } + inline static void priv_construct(dtl::false_type, Allocator &, T *p, BOOST_FWD_REF(Args) ...args) + { dtl::construct_type(p, ::boost::forward(args)...); } #else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) public: #define BOOST_CONTAINER_ALLOCATOR_TRAITS_CONSTRUCT_IMPL(N) \ template\ - BOOST_CONTAINER_FORCEINLINE static void construct(Allocator &a, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ + inline static void construct(Allocator &a, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ {\ - static const bool value = ::boost::move_detail::and_ \ + BOOST_STATIC_CONSTEXPR bool value = ::boost::move_detail::and_ \ < dtl::is_not_std_allocator \ , boost::container::dtl::has_member_function_callable_with_construct \ < Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_FWD_T##N > \ @@ -447,12 +586,12 @@ struct allocator_traits ///////////////////////////////// #define BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL(N) \ template\ - BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::true_type, Allocator &a, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ + inline static void priv_construct(dtl::true_type, Allocator &a, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ { a.construct( p BOOST_MOVE_I##N BOOST_MOVE_FWD##N ); }\ \ template\ - BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::false_type, Allocator &, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ - { ::new((void*)p, boost_container_new_t()) T(BOOST_MOVE_FWD##N); }\ + inline static void priv_construct(dtl::false_type, Allocator &, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ + { dtl::construct_type(p BOOST_MOVE_I##N BOOST_MOVE_FWD##N); }\ // BOOST_MOVE_ITERATE_0TO8(BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL) #undef BOOST_CONTAINER_ALLOCATOR_TRAITS_PRIV_CONSTRUCT_IMPL @@ -460,19 +599,19 @@ struct allocator_traits #endif // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template - BOOST_CONTAINER_FORCEINLINE static void priv_construct(dtl::false_type, Allocator &, T *p, const ::boost::container::default_init_t&) + inline static void priv_construct(dtl::false_type, Allocator &, T *p, const ::boost::container::default_init_t&) { ::new((void*)p, boost_container_new_t()) T; } - BOOST_CONTAINER_FORCEINLINE static bool priv_storage_is_unpropagable(dtl::true_type, const Allocator &a, pointer p) + inline static bool priv_storage_is_unpropagable(dtl::true_type, const Allocator &a, pointer p) { return a.storage_is_unpropagable(p); } - BOOST_CONTAINER_FORCEINLINE static bool priv_storage_is_unpropagable(dtl::false_type, const Allocator &, pointer) + inline static bool priv_storage_is_unpropagable(dtl::false_type, const Allocator &, pointer) { return false; } - BOOST_CONTAINER_FORCEINLINE static bool priv_equal(dtl::true_type, const Allocator &, const Allocator &) + inline static bool priv_equal(dtl::true_type, const Allocator &, const Allocator &) { return true; } - BOOST_CONTAINER_FORCEINLINE static bool priv_equal(dtl::false_type, const Allocator &a, const Allocator &b) + inline static bool priv_equal(dtl::false_type, const Allocator &a, const Allocator &b) { return a == b; } #endif //#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) diff --git a/highlight-wrapper/boost/container/container_fwd.hpp b/highlight-wrapper/boost/container/container_fwd.hpp index 9e82fdef..2525b7d2 100644 --- a/highlight-wrapper/boost/container/container_fwd.hpp +++ b/highlight-wrapper/boost/container/container_fwd.hpp @@ -15,6 +15,8 @@ # include #endif +#include + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -277,10 +279,10 @@ class basic_string; typedef basic_string string; typedef basic_string wstring; -static const std::size_t ADP_nodes_per_block = 256u; -static const std::size_t ADP_max_free_blocks = 2u; -static const std::size_t ADP_overhead_percent = 1u; -static const std::size_t ADP_only_alignment = 0u; +BOOST_STATIC_CONSTEXPR std::size_t ADP_nodes_per_block = 256u; +BOOST_STATIC_CONSTEXPR std::size_t ADP_max_free_blocks = 2u; +BOOST_STATIC_CONSTEXPR std::size_t ADP_overhead_percent = 1u; +BOOST_STATIC_CONSTEXPR std::size_t ADP_only_alignment = 0u; template < class T , std::size_t NodesPerBlock = ADP_nodes_per_block @@ -295,7 +297,7 @@ template < class T , unsigned int AllocationDisableMask = 0> class allocator; -static const std::size_t NodeAlloc_nodes_per_block = 256u; +BOOST_STATIC_CONSTEXPR std::size_t NodeAlloc_nodes_per_block = 256u; template < class T @@ -332,7 +334,7 @@ struct ordered_range_t //! Value used to tag that the input range is //! guaranteed to be ordered -static const ordered_range_t ordered_range = ordered_range_t(); +BOOST_CONTAINER_CONSTANT_VAR ordered_range_t ordered_range = ordered_range_t(); //! Type used to tag that the input range is //! guaranteed to be ordered and unique @@ -342,7 +344,7 @@ struct ordered_unique_range_t //! Value used to tag that the input range is //! guaranteed to be ordered and unique -static const ordered_unique_range_t ordered_unique_range = ordered_unique_range_t(); +BOOST_CONTAINER_CONSTANT_VAR ordered_unique_range_t ordered_unique_range = ordered_unique_range_t(); //! Type used to tag that the inserted values //! should be default initialized @@ -351,7 +353,7 @@ struct default_init_t //! Value used to tag that the inserted values //! should be default initialized -static const default_init_t default_init = default_init_t(); +BOOST_CONTAINER_CONSTANT_VAR default_init_t default_init = default_init_t(); #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED //! Type used to tag that the inserted values @@ -361,7 +363,7 @@ struct value_init_t //! Value used to tag that the inserted values //! should be value initialized -static const value_init_t value_init = value_init_t(); +BOOST_CONTAINER_CONSTANT_VAR value_init_t value_init = value_init_t(); namespace container_detail_really_deep_namespace { diff --git a/highlight-wrapper/boost/container/deque.hpp b/highlight-wrapper/boost/container/deque.hpp index dafcaa0c..c1cb4c42 100644 --- a/highlight-wrapper/boost/container/deque.hpp +++ b/highlight-wrapper/boost/container/deque.hpp @@ -68,16 +68,16 @@ template struct deque_value_traits { typedef T value_type; - static const bool trivial_dctr = dtl::is_trivially_destructible::value; - static const bool trivial_dctr_after_move = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = ::boost::has_trivial_destructor_after_move::value; }; template struct deque_block_size { - BOOST_STATIC_ASSERT_MSG(!(BlockBytes && BlockSize), "BlockBytes and BlockSize can't be specified at the same time"); - static const std::size_t block_bytes = BlockBytes ? BlockBytes : 512u; - static const std::size_t value = BlockSize ? BlockSize : (sizeof(T) < block_bytes ? (block_bytes/sizeof(T)) : std::size_t(1)); + BOOST_CONTAINER_STATIC_ASSERT_MSG(!(BlockBytes && BlockSize), "BlockBytes and BlockSize can't be specified at the same time"); + BOOST_STATIC_CONSTEXPR std::size_t block_bytes = BlockBytes ? BlockBytes : 512u; + BOOST_STATIC_CONSTEXPR std::size_t value = BlockSize ? BlockSize : (sizeof(T) < block_bytes ? (block_bytes/sizeof(T)) : std::size_t(1)); }; namespace dtl { @@ -106,6 +106,10 @@ namespace dtl { // [map, map + map_size). // A pointer in the range [map, map + map_size) points to an allocated node // if and only if the pointer is in the range [start.node, finish.node]. + +#define BOOST_CONTAINER_DEQUE_LIGHTER_ITERATOR_LEVEL 0 + +#if BOOST_CONTAINER_DEQUE_LIGHTER_ITERATOR_LEVEL == 0 template class deque_iterator { @@ -142,47 +146,47 @@ class deque_iterator public: - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE Pointer get_cur() const { return m_cur; } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE Pointer get_first() const { return m_first; } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE Pointer get_last() const { return m_last; } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE index_pointer get_node() const { return m_node; } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_cur() const { return m_cur; } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_first() const { return m_first; } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_last() const { return m_last; } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline index_pointer get_node() const { return m_node; } - BOOST_CONTAINER_FORCEINLINE deque_iterator(val_alloc_ptr x, index_pointer y, difference_type block_size) BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator(val_alloc_ptr x, index_pointer y, difference_type block_size) BOOST_NOEXCEPT_OR_NOTHROW : m_cur(x), m_first(*y), m_last(*y + block_size), m_node(y) {} - BOOST_CONTAINER_FORCEINLINE deque_iterator(val_alloc_ptr x, index_pointer y, size_type block_size) BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator(val_alloc_ptr x, index_pointer y, size_type block_size) BOOST_NOEXCEPT_OR_NOTHROW : m_cur(x), m_first(*y), m_last(*y + difference_type(block_size)), m_node(y) {} - BOOST_CONTAINER_FORCEINLINE deque_iterator() BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator() BOOST_NOEXCEPT_OR_NOTHROW : m_cur(), m_first(), m_last(), m_node() //Value initialization to achieve "null iterators" (N3644) {} - BOOST_CONTAINER_FORCEINLINE deque_iterator(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW : m_cur(x.get_cur()), m_first(x.get_first()), m_last(x.get_last()), m_node(x.get_node()) {} - BOOST_CONTAINER_FORCEINLINE deque_iterator(const nonconst_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator(const nonconst_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW : m_cur(x.get_cur()), m_first(x.get_first()), m_last(x.get_last()), m_node(x.get_node()) {} - BOOST_CONTAINER_FORCEINLINE deque_iterator(Pointer cur, Pointer first, Pointer last, index_pointer node) BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator(Pointer cur, Pointer first, Pointer last, index_pointer node) BOOST_NOEXCEPT_OR_NOTHROW : m_cur(cur), m_first(first), m_last(last), m_node(node) {} - BOOST_CONTAINER_FORCEINLINE deque_iterator& operator=(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator& operator=(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW { m_cur = x.get_cur(); m_first = x.get_first(); m_last = x.get_last(); m_node = x.get_node(); return *this; } - BOOST_CONTAINER_FORCEINLINE deque_iterator unconst() const BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator unconst() const BOOST_NOEXCEPT_OR_NOTHROW { return deque_iterator(this->get_cur(), this->get_first(), this->get_last(), this->get_node()); } - BOOST_CONTAINER_FORCEINLINE reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW + inline reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW { return *this->m_cur; } - BOOST_CONTAINER_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW + inline pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW { return this->m_cur; } BOOST_CONTAINER_ATTRIBUTE_NODISCARD difference_type operator-(const deque_iterator& x) const BOOST_NOEXCEPT_OR_NOTHROW @@ -209,7 +213,7 @@ class deque_iterator return *this; } - BOOST_CONTAINER_FORCEINLINE deque_iterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW { deque_iterator tmp(*this); ++*this; @@ -229,7 +233,7 @@ class deque_iterator return *this; } - BOOST_CONTAINER_FORCEINLINE deque_iterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW + inline deque_iterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW { deque_iterator tmp(*this); --*this; @@ -241,15 +245,15 @@ class deque_iterator if (!n) return *this; BOOST_ASSERT(!!m_cur); - difference_type offset = n + (this->m_cur - this->m_first); + const difference_type offset = n + (this->m_cur - this->m_first); const difference_type block_size = m_last - m_first; BOOST_ASSERT(block_size); if (offset >= 0 && offset < block_size) this->m_cur += difference_type(n); else { - difference_type node_offset = - offset > 0 ? (offset / block_size) - : (-difference_type((-offset - 1) / block_size) - 1); + const difference_type node_offset = + offset > 0 ? (offset / block_size) + : (-difference_type((-offset - 1) / block_size) - 1); this->priv_set_node(this->m_node + node_offset, size_type(block_size)); this->m_cur = this->m_first + (offset - node_offset * block_size); @@ -257,55 +261,55 @@ class deque_iterator return *this; } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline deque_iterator operator+(difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW { deque_iterator tmp(*this); return tmp += n; } - BOOST_CONTAINER_FORCEINLINE + inline deque_iterator& operator-=(difference_type n) BOOST_NOEXCEPT_OR_NOTHROW { return *this += -n; } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline deque_iterator operator-(difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW { deque_iterator tmp(*this); return tmp -= n; } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline reference operator[](difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW { return *(*this + n); } //Comparisons - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator==(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return l.m_cur == r.m_cur; } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator!=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return l.m_cur != r.m_cur; } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator<(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return (l.m_node == r.m_node) ? (l.m_cur < r.m_cur) : (l.m_node < r.m_node); } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator>(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return r < l; } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator<=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return !(r < l); } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator>=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW { return !(l < r); } - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend deque_iterator operator+(difference_type n, deque_iterator x) BOOST_NOEXCEPT_OR_NOTHROW { return x += n; } - BOOST_CONTAINER_FORCEINLINE void priv_set_node(index_pointer new_node, size_type block_size) BOOST_NOEXCEPT_OR_NOTHROW + inline void priv_set_node(index_pointer new_node, size_type block_size) BOOST_NOEXCEPT_OR_NOTHROW { return this->priv_set_node(new_node, difference_type(block_size)); } - BOOST_CONTAINER_FORCEINLINE void priv_set_node(index_pointer new_node, difference_type block_size) BOOST_NOEXCEPT_OR_NOTHROW + inline void priv_set_node(index_pointer new_node, difference_type block_size) BOOST_NOEXCEPT_OR_NOTHROW { this->m_node = new_node; this->m_first = *new_node; @@ -313,6 +317,447 @@ class deque_iterator } }; +#elif BOOST_CONTAINER_DEQUE_LIGHTER_ITERATOR_LEVEL == 1 + +template +class deque_iterator +{ + public: + typedef std::random_access_iterator_tag iterator_category; + typedef typename boost::intrusive::pointer_traits::element_type value_type; + typedef typename boost::intrusive::pointer_traits::difference_type difference_type; + typedef typename boost::intrusive::pointer_traits::size_type size_type; + typedef typename if_c + < IsConst + , typename boost::intrusive::pointer_traits::template + rebind_pointer::type + , Pointer + >::type pointer; + typedef typename if_c + < IsConst + , const value_type& + , value_type& + >::type reference; + + BOOST_CONSTEXPR inline static size_type get_block_size() BOOST_NOEXCEPT_OR_NOTHROW + { return deque_block_size::value; } + + BOOST_CONSTEXPR inline static difference_type get_block_ssize() BOOST_NOEXCEPT_OR_NOTHROW + { return difference_type((get_block_size())); } + + class nat; + typedef typename dtl::if_c< IsConst + , deque_iterator + , nat>::type nonconst_iterator; + + typedef Pointer val_alloc_ptr; + typedef typename boost::intrusive::pointer_traits:: + template rebind_pointer::type index_pointer; + + Pointer m_cur; + Pointer m_first; + index_pointer m_node; + + public: + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_cur() const { return m_cur; } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_first() const { return m_first; } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_last() const { return m_first + get_block_ssize(); } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline index_pointer get_node() const { return m_node; } + + inline deque_iterator(val_alloc_ptr x, index_pointer y, difference_type ) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(x), m_first(*y), m_node(y) + {} + + inline deque_iterator(val_alloc_ptr x, index_pointer y, size_type ) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(x), m_first(*y), m_node(y) + {} + + inline deque_iterator() BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(), m_first(), m_node() //Value initialization to achieve "null iterators" (N3644) + {} + + inline deque_iterator(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(x.get_cur()), m_first(x.get_first()), m_node(x.get_node()) + {} + + inline deque_iterator(const nonconst_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(x.get_cur()), m_first(x.get_first()), m_node(x.get_node()) + {} + + inline deque_iterator(Pointer cur, Pointer first, index_pointer node) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(cur), m_first(first), m_node(node) + {} + + inline deque_iterator& operator=(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW + { m_cur = x.get_cur(); m_first = x.get_first(); m_node = x.get_node(); return *this; } + + inline nonconst_iterator unconst() const BOOST_NOEXCEPT_OR_NOTHROW + { + return nonconst_iterator(this->get_cur(), this->get_first(), this->get_node()); + } + + inline reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW + { return *this->m_cur; } + + inline pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW + { return this->m_cur; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD difference_type operator-(const deque_iterator& x) const BOOST_NOEXCEPT_OR_NOTHROW + { + if(!this->m_cur && !x.m_cur){ + return 0; + } + const difference_type block_size = get_block_ssize(); + BOOST_ASSERT(block_size); + return block_size * (this->m_node - x.m_node - 1) + + (this->m_cur - this->m_first) + ((x.m_first+block_size) - x.m_cur); + } + + deque_iterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW + { + BOOST_ASSERT(!!m_cur); + ++this->m_cur; + const difference_type block_size = get_block_ssize(); + if (this->m_cur == (this->m_first+block_size)) { + + BOOST_ASSERT(block_size); + ++this->m_node; + this->m_first = *this->m_node; + this->m_cur = this->m_first; + } + return *this; + } + + inline deque_iterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW + { + deque_iterator tmp(*this); + ++*this; + return tmp; + } + + deque_iterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW + { + BOOST_ASSERT(!!m_cur); + if (this->m_cur == this->m_first) { + --this->m_node; + this->m_first = *this->m_node; + this->m_cur = this->m_first + get_block_ssize(); + } + --this->m_cur; + return *this; + } + + inline deque_iterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW + { + deque_iterator tmp(*this); + --*this; + return tmp; + } + + deque_iterator& operator+=(difference_type n) BOOST_NOEXCEPT_OR_NOTHROW + { + if (!n) + return *this; + BOOST_ASSERT(!!m_cur); + const difference_type offset = n + (this->m_cur - this->m_first); + const difference_type block_size = get_block_ssize(); + BOOST_ASSERT(block_size); + if (offset >= 0 && offset < block_size) + this->m_cur += difference_type(n); + else { + const difference_type node_offset = + offset > 0 ? (offset / block_size) + : (-difference_type((-offset - 1) / block_size) - 1); + this->m_node += node_offset; + this->m_first = *this->m_node; + this->m_cur = this->m_first + (offset - node_offset * block_size); + } + return *this; + } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + deque_iterator operator+(difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW + { deque_iterator tmp(*this); return tmp += n; } + + inline + deque_iterator& operator-=(difference_type n) BOOST_NOEXCEPT_OR_NOTHROW + { return *this += -n; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + deque_iterator operator-(difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW + { deque_iterator tmp(*this); return tmp -= n; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + reference operator[](difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW + { return *(*this + n); } + + //Comparisons + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator==(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return l.m_cur == r.m_cur; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator!=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return l.m_cur != r.m_cur; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator<(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return (l.m_node == r.m_node) ? (l.m_cur < r.m_cur) : (l.m_node < r.m_node); } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator>(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return r < l; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator<=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return !(r < l); } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator>=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return !(l < r); } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend deque_iterator operator+(difference_type n, deque_iterator x) BOOST_NOEXCEPT_OR_NOTHROW + { return x += n; } + + inline void priv_set_node(index_pointer new_node, size_type ) BOOST_NOEXCEPT_OR_NOTHROW + { return this->priv_set_node(new_node, difference_type()); } + + inline void priv_set_node(index_pointer new_node, difference_type) BOOST_NOEXCEPT_OR_NOTHROW + { + this->m_node = new_node; + this->m_first = *new_node; + } +}; + +#elif BOOST_CONTAINER_DEQUE_LIGHTER_ITERATOR_LEVEL == 2 + +template +class deque_iterator +{ + public: + typedef std::random_access_iterator_tag iterator_category; + typedef typename boost::intrusive::pointer_traits::element_type value_type; + typedef typename boost::intrusive::pointer_traits::difference_type difference_type; + typedef typename boost::intrusive::pointer_traits::size_type size_type; + typedef typename if_c + < IsConst + , typename boost::intrusive::pointer_traits::template + rebind_pointer::type + , Pointer + >::type pointer; + typedef typename if_c + < IsConst + , const value_type& + , value_type& + >::type reference; + + BOOST_CONSTEXPR inline static size_type get_block_size() BOOST_NOEXCEPT_OR_NOTHROW + { + BOOST_CONTAINER_STATIC_ASSERT((deque_block_size::value)); + return deque_block_size::value; + } + + BOOST_CONSTEXPR inline static difference_type get_block_ssize() BOOST_NOEXCEPT_OR_NOTHROW + { return difference_type((get_block_size())); } + + class nat; + typedef typename dtl::if_c< IsConst + , deque_iterator + , nat>::type nonconst_iterator; + + typedef Pointer val_alloc_ptr; + typedef typename boost::intrusive::pointer_traits:: + template rebind_pointer::type index_pointer; + + Pointer m_cur; + index_pointer m_node; + + public: + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_cur() const { return m_cur; } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_first() const { return *m_node; } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline Pointer get_last() const { return *m_node + get_block_ssize(); } + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline index_pointer get_node() const { return m_node; } + + inline deque_iterator(val_alloc_ptr x, index_pointer y, difference_type ) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(x), m_node(y) + {} + + inline deque_iterator(val_alloc_ptr x, index_pointer y, size_type ) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(x), m_node(y) + {} + + inline deque_iterator() BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(), m_node() //Value initialization to achieve "null iterators" (N3644) + {} + + inline deque_iterator(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(x.get_cur()), m_node(x.get_node()) + {} + + inline deque_iterator(const nonconst_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(x.get_cur()), m_node(x.get_node()) + {} + + inline deque_iterator(Pointer cur, index_pointer node) BOOST_NOEXCEPT_OR_NOTHROW + : m_cur(cur), m_node(node) + {} + + inline deque_iterator& operator=(const deque_iterator& x) BOOST_NOEXCEPT_OR_NOTHROW + { m_cur = x.get_cur(); m_node = x.get_node(); return *this; } + + inline nonconst_iterator unconst() const BOOST_NOEXCEPT_OR_NOTHROW + { + return nonconst_iterator(this->get_cur(), this->get_node()); + } + + inline reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW + { return *this->m_cur; } + + inline pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW + { return this->m_cur; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD difference_type operator-(const deque_iterator& x) const BOOST_NOEXCEPT_OR_NOTHROW + { + if(!this->m_cur && !x.m_cur){ + return 0; + } + const difference_type block_size = get_block_ssize(); + BOOST_ASSERT(block_size); + return block_size * (this->m_node - x.m_node - 1) + + (this->m_cur - this->get_first()) + (x.get_last() - x.m_cur); + } + + deque_iterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW + { + BOOST_ASSERT(!!m_cur); + ++this->m_cur; + if (this->m_cur == (this->get_last())) { + + ++this->m_node; + this->m_cur = *this->m_node; + } + return *this; + } + + inline deque_iterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW + { + deque_iterator tmp(*this); + ++*this; + return tmp; + } + + deque_iterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW + { + BOOST_ASSERT(!!m_cur); + if (this->m_cur == this->get_first()) { + --this->m_node; + this->m_cur = this->get_last(); + } + --this->m_cur; + return *this; + } + + inline deque_iterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW + { + deque_iterator tmp(*this); + --*this; + return tmp; + } + + deque_iterator& operator+=(difference_type n) BOOST_NOEXCEPT_OR_NOTHROW + { + if (!n) + return *this; + BOOST_ASSERT(!!m_cur); + const difference_type offset = n + (this->m_cur - this->get_first()); + const difference_type block_size = get_block_ssize(); + BOOST_ASSERT(block_size); + if (offset >= 0 && offset < block_size) + this->m_cur += difference_type(n); + else { + const difference_type node_offset = + offset > 0 ? (offset / block_size) + : (-difference_type((-offset - 1) / block_size) - 1); + this->m_node += node_offset; + this->m_cur = this->get_first() + (offset - node_offset * block_size); + } + return *this; + } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + deque_iterator operator+(difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW + { deque_iterator tmp(*this); return tmp += n; } + + inline + deque_iterator& operator-=(difference_type n) BOOST_NOEXCEPT_OR_NOTHROW + { return *this += -n; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + deque_iterator operator-(difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW + { deque_iterator tmp(*this); return tmp -= n; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + reference operator[](difference_type n) const BOOST_NOEXCEPT_OR_NOTHROW + { + BOOST_ASSERT(!!m_cur); + const difference_type offset = n + (this->m_cur - this->get_first()); + const difference_type block_size = get_block_ssize(); + if (offset >= 0 && offset < block_size) + return this->m_cur[difference_type(n)]; + else { + const difference_type node_offset = offset > 0 + ? (offset / block_size) + : (-difference_type((-offset - 1) / block_size) - 1); + return (this->m_node[node_offset]) [offset - node_offset * block_size]; + } + } + + //Comparisons + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator==(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return l.m_cur == r.m_cur; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator!=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return l.m_cur != r.m_cur; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator<(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return (l.m_node == r.m_node) ? (l.m_cur < r.m_cur) : (l.m_node < r.m_node); } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator>(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return r < l; } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator<=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return !(r < l); } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend bool operator>=(const deque_iterator& l, const deque_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW + { return !(l < r); } + + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline + friend deque_iterator operator+(difference_type n, deque_iterator x) BOOST_NOEXCEPT_OR_NOTHROW + { return x += n; } + + inline void priv_set_node(index_pointer new_node, size_type ) BOOST_NOEXCEPT_OR_NOTHROW + { return this->priv_set_node(new_node, difference_type()); } + + inline void priv_set_node(index_pointer new_node, difference_type) BOOST_NOEXCEPT_OR_NOTHROW + { + this->m_node = new_node; + } +}; + +#else + +#error "Invalid BOOST_CONTAINER_DEQUE_LIGHTER_ITERATOR_LEVEL" + +#endif } //namespace dtl { template @@ -360,43 +805,48 @@ class deque_base typedef typename get_deque_opt::type options_type; protected: + #if BOOST_CONTAINER_DEQUE_LIGHTER_ITERATOR_LEVEL == 0 typedef dtl::deque_iterator iterator; - typedef dtl::deque_iterator const_iterator; + typedef dtl::deque_iterator const_iterator; + #else + typedef dtl::deque_iterator iterator; + typedef dtl::deque_iterator const_iterator; + #endif - BOOST_CONSTEXPR BOOST_CONTAINER_FORCEINLINE static size_type get_block_size() BOOST_NOEXCEPT_OR_NOTHROW - { return deque_block_size::value; } + BOOST_CONSTEXPR inline static val_alloc_diff get_block_ssize() BOOST_NOEXCEPT_OR_NOTHROW + { return val_alloc_diff((get_block_size())); } - BOOST_CONSTEXPR BOOST_CONTAINER_FORCEINLINE static val_alloc_diff get_block_ssize() BOOST_NOEXCEPT_OR_NOTHROW - { return val_alloc_diff((get_block_size)()); } + BOOST_CONSTEXPR inline static size_type get_block_size() BOOST_NOEXCEPT_OR_NOTHROW + { return deque_block_size::value; } typedef deque_value_traits traits_t; typedef ptr_alloc_t map_allocator_type; - BOOST_CONTAINER_FORCEINLINE val_alloc_ptr priv_allocate_node() + inline val_alloc_ptr priv_allocate_node() { return this->alloc().allocate(get_block_size()); } - BOOST_CONTAINER_FORCEINLINE void priv_deallocate_node(val_alloc_ptr p) BOOST_NOEXCEPT_OR_NOTHROW + inline void priv_deallocate_node(val_alloc_ptr p) BOOST_NOEXCEPT_OR_NOTHROW { this->alloc().deallocate(p, get_block_size()); } - BOOST_CONTAINER_FORCEINLINE ptr_alloc_ptr priv_allocate_map(size_type n) + inline ptr_alloc_ptr priv_allocate_map(size_type n) { return this->ptr_alloc().allocate(n); } - BOOST_CONTAINER_FORCEINLINE void priv_deallocate_map(ptr_alloc_ptr p, size_type n) BOOST_NOEXCEPT_OR_NOTHROW + inline void priv_deallocate_map(ptr_alloc_ptr p, size_type n) BOOST_NOEXCEPT_OR_NOTHROW { this->ptr_alloc().deallocate(p, n); } - BOOST_CONTAINER_FORCEINLINE deque_base(size_type num_elements, const allocator_type& a) + inline deque_base(size_type num_elements, const allocator_type& a) : members_(a) { this->priv_initialize_map(num_elements); } - BOOST_CONTAINER_FORCEINLINE explicit deque_base(const allocator_type& a) + inline explicit deque_base(const allocator_type& a) : members_(a) {} - BOOST_CONTAINER_FORCEINLINE deque_base() + inline deque_base() : members_() {} - BOOST_CONTAINER_FORCEINLINE explicit deque_base(BOOST_RV_REF(deque_base) x) + inline explicit deque_base(BOOST_RV_REF(deque_base) x) : members_( boost::move(x.ptr_alloc()) , boost::move(x.alloc()) ) {} @@ -446,8 +896,8 @@ class deque_base this->members_.m_start.priv_set_node(nstart, get_block_size()); this->members_.m_finish.priv_set_node(nfinish - 1, get_block_size()); - this->members_.m_start.m_cur = this->members_.m_start.m_first; - this->members_.m_finish.m_cur = this->members_.m_finish.m_first + difference_type(num_elements % get_block_size()); + this->members_.m_start.m_cur = this->members_.m_start.get_first(); + this->members_.m_finish.m_cur = this->members_.m_finish.get_first() + difference_type(num_elements % get_block_size()); // } } @@ -516,16 +966,16 @@ class deque_base iterator m_finish; } members_; - BOOST_CONTAINER_FORCEINLINE ptr_alloc_t &ptr_alloc() BOOST_NOEXCEPT_OR_NOTHROW + inline ptr_alloc_t &ptr_alloc() BOOST_NOEXCEPT_OR_NOTHROW { return members_; } - BOOST_CONTAINER_FORCEINLINE const ptr_alloc_t &ptr_alloc() const BOOST_NOEXCEPT_OR_NOTHROW + inline const ptr_alloc_t &ptr_alloc() const BOOST_NOEXCEPT_OR_NOTHROW { return members_; } - BOOST_CONTAINER_FORCEINLINE allocator_type &alloc() BOOST_NOEXCEPT_OR_NOTHROW + inline allocator_type &alloc() BOOST_NOEXCEPT_OR_NOTHROW { return members_; } - BOOST_CONTAINER_FORCEINLINE const allocator_type &alloc() const BOOST_NOEXCEPT_OR_NOTHROW + inline const allocator_type &alloc() const BOOST_NOEXCEPT_OR_NOTHROW { return members_; } }; #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -576,6 +1026,11 @@ class deque : protected deque_base::type, #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED private: // Internal typedefs + + //`allocator_type::value_type` must match container's `value type`. If this + //assertion fails, please review your allocator definition. + BOOST_CONTAINER_STATIC_ASSERT((dtl::is_same::value_type>::value)); + BOOST_COPYABLE_AND_MOVABLE(deque) typedef typename Base::ptr_alloc_ptr index_pointer; typedef allocator_traits allocator_traits_type; @@ -600,7 +1055,7 @@ class deque : protected deque_base::type, //! Throws: If allocator_type's default constructor throws. //! //! Complexity: Constant. - BOOST_CONTAINER_FORCEINLINE deque() + inline deque() BOOST_NOEXCEPT_IF(dtl::is_nothrow_default_constructible::value) : Base() {} @@ -610,7 +1065,7 @@ class deque : protected deque_base::type, //! Throws: Nothing //! //! Complexity: Constant. - BOOST_CONTAINER_FORCEINLINE explicit deque(const allocator_type& a) BOOST_NOEXCEPT_OR_NOTHROW + inline explicit deque(const allocator_type& a) BOOST_NOEXCEPT_OR_NOTHROW : Base(a) {} @@ -621,7 +1076,7 @@ class deque : protected deque_base::type, //! throws or T's value initialization throws. //! //! Complexity: Linear to n. - BOOST_CONTAINER_FORCEINLINE explicit deque(size_type n) + inline explicit deque(size_type n) : Base(n, allocator_type()) { dtl::insert_value_initialized_n_proxy proxy; @@ -638,7 +1093,7 @@ class deque : protected deque_base::type, //! Complexity: Linear to n. //! //! Note: Non-standard extension - BOOST_CONTAINER_FORCEINLINE deque(size_type n, default_init_t) + inline deque(size_type n, default_init_t) : Base(n, allocator_type()) { dtl::insert_default_initialized_n_proxy proxy; @@ -653,7 +1108,7 @@ class deque : protected deque_base::type, //! throws or T's value initialization throws. //! //! Complexity: Linear to n. - BOOST_CONTAINER_FORCEINLINE explicit deque(size_type n, const allocator_type &a) + inline explicit deque(size_type n, const allocator_type &a) : Base(n, a) { dtl::insert_value_initialized_n_proxy proxy; @@ -670,7 +1125,7 @@ class deque : protected deque_base::type, //! Complexity: Linear to n. //! //! Note: Non-standard extension - BOOST_CONTAINER_FORCEINLINE deque(size_type n, default_init_t, const allocator_type &a) + inline deque(size_type n, default_init_t, const allocator_type &a) : Base(n, a) { dtl::insert_default_initialized_n_proxy proxy; @@ -685,7 +1140,7 @@ class deque : protected deque_base::type, //! throws or T's copy constructor throws. //! //! Complexity: Linear to n. - BOOST_CONTAINER_FORCEINLINE deque(size_type n, const value_type& value) + inline deque(size_type n, const value_type& value) : Base(n, allocator_type()) { this->priv_fill_initialize(value); } @@ -696,7 +1151,7 @@ class deque : protected deque_base::type, //! throws or T's copy constructor throws. //! //! Complexity: Linear to n. - BOOST_CONTAINER_FORCEINLINE deque(size_type n, const value_type& value, const allocator_type& a) + inline deque(size_type n, const value_type& value, const allocator_type& a) : Base(n, a) { this->priv_fill_initialize(value); } @@ -708,7 +1163,7 @@ class deque : protected deque_base::type, //! //! Complexity: Linear to the range [first, last). template - BOOST_CONTAINER_FORCEINLINE deque(InIt first, InIt last + inline deque(InIt first, InIt last #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED) , typename dtl::disable_if_convertible ::type * = 0 @@ -727,7 +1182,7 @@ class deque : protected deque_base::type, //! //! Complexity: Linear to the range [first, last). template - BOOST_CONTAINER_FORCEINLINE deque(InIt first, InIt last, const allocator_type& a + inline deque(InIt first, InIt last, const allocator_type& a #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED) , typename dtl::disable_if_convertible ::type * = 0 @@ -746,7 +1201,7 @@ class deque : protected deque_base::type, //! throws or T's constructor taking a dereferenced std::initializer_list iterator throws. //! //! Complexity: Linear to the range [il.begin(), il.end()). - BOOST_CONTAINER_FORCEINLINE deque(std::initializer_list il, const allocator_type& a = allocator_type()) + inline deque(std::initializer_list il, const allocator_type& a = allocator_type()) : Base(a) { this->priv_range_initialize(il.begin(), il.end()); @@ -758,7 +1213,7 @@ class deque : protected deque_base::type, //! Postcondition: x == *this. //! //! Complexity: Linear to the elements x contains. - BOOST_CONTAINER_FORCEINLINE deque(const deque& x) + inline deque(const deque& x) : Base(allocator_traits_type::select_on_container_copy_construction(x.alloc())) { if(x.size()){ @@ -773,7 +1228,7 @@ class deque : protected deque_base::type, //! Throws: If allocator_type's copy constructor throws. //! //! Complexity: Constant. - BOOST_CONTAINER_FORCEINLINE deque(BOOST_RV_REF(deque) x) BOOST_NOEXCEPT_OR_NOTHROW + inline deque(BOOST_RV_REF(deque) x) BOOST_NOEXCEPT_OR_NOTHROW : Base(BOOST_MOVE_BASE(Base, x)) { this->swap_members(x); } @@ -824,7 +1279,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Linear to the number of elements. - BOOST_CONTAINER_FORCEINLINE ~deque() BOOST_NOEXCEPT_OR_NOTHROW + inline ~deque() BOOST_NOEXCEPT_OR_NOTHROW { this->priv_destroy_range(this->members_.m_start, this->members_.m_finish); } @@ -868,28 +1323,13 @@ class deque : protected deque_base::type, || allocator_traits_type::is_always_equal::value) { if (BOOST_LIKELY(this != &x)) { - allocator_type &this_alloc = this->alloc(); - allocator_type &x_alloc = x.alloc(); - const bool propagate_alloc = allocator_traits_type:: - propagate_on_container_move_assignment::value; - dtl::bool_ flag; - const bool allocators_equal = this_alloc == x_alloc; (void)allocators_equal; - //Resources can be transferred if both allocators are - //going to be equal after this function (either propagated or already equal) - if(propagate_alloc || allocators_equal){ - //Destroy objects but retain memory in case x reuses it in the future - this->clear(); - //Move allocator if needed - dtl::move_alloc(this_alloc, x_alloc, flag); - dtl::move_alloc(this->ptr_alloc(), x.ptr_alloc(), flag); - //Nothrow swap - this->swap_members(x); - } - //Else do a one by one move - else{ - this->assign( boost::make_move_iterator(x.begin()) - , boost::make_move_iterator(x.end())); - } + //We know resources can be transferred at comiple time if both allocators are + //always equal or the allocator is going to be propagated + const bool can_steal_resources_alloc + = allocator_traits_type::propagate_on_container_move_assignment::value + || allocator_traits_type::is_always_equal::value; + dtl::bool_ flag; + this->priv_move_assign(boost::move(x), flag); } return *this; } @@ -903,7 +1343,7 @@ class deque : protected deque_base::type, //! Throws: If memory allocation throws or T's copy constructor throws. //! //! Complexity: Linear to the number of elements in il. - BOOST_CONTAINER_FORCEINLINE deque& operator=(std::initializer_list il) + inline deque& operator=(std::initializer_list il) { this->assign(il.begin(), il.end()); return *this; @@ -915,7 +1355,7 @@ class deque : protected deque_base::type, //! Throws: If memory allocation throws or T's copy constructor throws. //! //! Complexity: Linear to n. - BOOST_CONTAINER_FORCEINLINE void assign(size_type n, const T& val) + inline void assign(size_type n, const T& val) { this->assign(c_it(val, n), c_it()); } @@ -979,7 +1419,7 @@ class deque : protected deque_base::type, //! T's constructor from dereferencing std::initializer_list iterator throws. //! //! Complexity: Linear to il.size(). - BOOST_CONTAINER_FORCEINLINE void assign(std::initializer_list il) + inline void assign(std::initializer_list il) { this->assign(il.begin(), il.end()); } #endif @@ -988,7 +1428,7 @@ class deque : protected deque_base::type, //! Throws: If allocator's copy constructor throws. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline allocator_type get_allocator() const BOOST_NOEXCEPT_OR_NOTHROW { return Base::alloc(); } @@ -999,7 +1439,7 @@ class deque : protected deque_base::type, //! Complexity: Constant. //! //! Note: Non-standard extension. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const stored_allocator_type &get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW { return Base::alloc(); } @@ -1016,7 +1456,7 @@ class deque : protected deque_base::type, //! Complexity: Constant. //! //! Note: Non-standard extension. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline stored_allocator_type &get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW { return Base::alloc(); } @@ -1025,7 +1465,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline iterator begin() BOOST_NOEXCEPT_OR_NOTHROW { return this->members_.m_start; } @@ -1034,7 +1474,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_iterator begin() const BOOST_NOEXCEPT_OR_NOTHROW { return this->members_.m_start; } @@ -1043,7 +1483,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline iterator end() BOOST_NOEXCEPT_OR_NOTHROW { return this->members_.m_finish; } @@ -1052,7 +1492,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_iterator end() const BOOST_NOEXCEPT_OR_NOTHROW { return this->members_.m_finish; } @@ -1062,7 +1502,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline reverse_iterator rbegin() BOOST_NOEXCEPT_OR_NOTHROW { return reverse_iterator(this->members_.m_finish); } @@ -1072,7 +1512,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_reverse_iterator rbegin() const BOOST_NOEXCEPT_OR_NOTHROW { return const_reverse_iterator(this->members_.m_finish); } @@ -1082,7 +1522,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline reverse_iterator rend() BOOST_NOEXCEPT_OR_NOTHROW { return reverse_iterator(this->members_.m_start); } @@ -1092,7 +1532,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_reverse_iterator rend() const BOOST_NOEXCEPT_OR_NOTHROW { return const_reverse_iterator(this->members_.m_start); } @@ -1101,7 +1541,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_iterator cbegin() const BOOST_NOEXCEPT_OR_NOTHROW { return this->members_.m_start; } @@ -1110,7 +1550,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_iterator cend() const BOOST_NOEXCEPT_OR_NOTHROW { return this->members_.m_finish; } @@ -1120,7 +1560,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_reverse_iterator crbegin() const BOOST_NOEXCEPT_OR_NOTHROW { return const_reverse_iterator(this->members_.m_finish); } @@ -1130,7 +1570,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW { return const_reverse_iterator(this->members_.m_start); } @@ -1145,7 +1585,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline bool empty() const BOOST_NOEXCEPT_OR_NOTHROW { return this->members_.m_finish == this->members_.m_start; } @@ -1154,7 +1594,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline size_type size() const BOOST_NOEXCEPT_OR_NOTHROW { return size_type(this->members_.m_finish - this->members_.m_start); } @@ -1163,7 +1603,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW { return allocator_traits_type::max_size(this->alloc()); } @@ -1251,7 +1691,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline reference front() BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(!this->empty()); @@ -1266,7 +1706,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_reference front() const BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(!this->empty()); @@ -1281,7 +1721,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline reference back() BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(!this->empty()); @@ -1296,7 +1736,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_reference back() const BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(!this->empty()); @@ -1311,7 +1751,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline reference operator[](size_type n) BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(this->size() > n); @@ -1326,7 +1766,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_reference operator[](size_type n) const BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(this->size() > n); @@ -1344,7 +1784,7 @@ class deque : protected deque_base::type, //! Complexity: Constant. //! //! Note: Non-standard extension - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline iterator nth(size_type n) BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(this->size() >= n); @@ -1362,7 +1802,7 @@ class deque : protected deque_base::type, //! Complexity: Constant. //! //! Note: Non-standard extension - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_iterator nth(size_type n) const BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(this->size() >= n); @@ -1379,7 +1819,7 @@ class deque : protected deque_base::type, //! Complexity: Constant. //! //! Note: Non-standard extension - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline size_type index_of(iterator p) BOOST_NOEXCEPT_OR_NOTHROW { //Range checked priv_index_of @@ -1396,7 +1836,7 @@ class deque : protected deque_base::type, //! Complexity: Constant. //! //! Note: Non-standard extension - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline size_type index_of(const_iterator p) const BOOST_NOEXCEPT_OR_NOTHROW { //Range checked priv_index_of @@ -1411,7 +1851,7 @@ class deque : protected deque_base::type, //! Throws: range_error if n >= size() //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline reference at(size_type n) { this->priv_throw_if_out_of_range(n); @@ -1426,7 +1866,7 @@ class deque : protected deque_base::type, //! Throws: range_error if n >= size() //! //! Complexity: Constant. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline const_reference at(size_type n) const { this->priv_throw_if_out_of_range(n); @@ -1659,7 +2099,7 @@ class deque : protected deque_base::type, //! Throws: If memory allocation throws or T's copy constructor throws. //! //! Complexity: Linear to n. - BOOST_CONTAINER_FORCEINLINE iterator insert(const_iterator pos, size_type n, const value_type& x) + inline iterator insert(const_iterator pos, size_type n, const value_type& x) { //Range check of p is done by insert() return this->insert(pos, c_it(x, n), c_it()); @@ -1708,7 +2148,7 @@ class deque : protected deque_base::type, //! dereferenced std::initializer_list throws or T's copy constructor throws. //! //! Complexity: Linear to distance [il.begin(), il.end()). - BOOST_CONTAINER_FORCEINLINE iterator insert(const_iterator pos, std::initializer_list il) + inline iterator insert(const_iterator pos, std::initializer_list il) { //Range check os pos is done in insert() return insert(pos, il.begin(), il.end()); @@ -1717,7 +2157,7 @@ class deque : protected deque_base::type, #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED) template - BOOST_CONTAINER_FORCEINLINE iterator insert(const_iterator p, FwdIt first, FwdIt last + inline iterator insert(const_iterator p, FwdIt first, FwdIt last #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED) , typename dtl::disable_if_or < void @@ -1741,7 +2181,7 @@ class deque : protected deque_base::type, void pop_front() BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(!this->empty()); - if (this->members_.m_start.m_cur != this->members_.m_start.m_last - 1) { + if (this->members_.m_start.m_cur != this->members_.m_start.get_last() - 1) { allocator_traits_type::destroy ( this->alloc() , boost::movelib::to_raw_pointer(this->members_.m_start.m_cur) @@ -1760,7 +2200,7 @@ class deque : protected deque_base::type, void pop_back() BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT(!this->empty()); - if (this->members_.m_finish.m_cur != this->members_.m_finish.m_first) { + if (this->members_.m_finish.m_cur != this->members_.m_finish.get_first()) { --this->members_.m_finish.m_cur; allocator_traits_type::destroy ( this->alloc() @@ -1838,7 +2278,7 @@ class deque : protected deque_base::type, //! Throws: Nothing. //! //! Complexity: Constant. - BOOST_CONTAINER_FORCEINLINE void swap(deque &x) + inline void swap(deque &x) BOOST_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_swap::value || allocator_traits_type::is_always_equal::value) { @@ -1865,9 +2305,9 @@ class deque : protected deque_base::type, } if (this->members_.m_start.m_node != this->members_.m_finish.m_node) { - this->priv_destroy_range(this->members_.m_start.m_cur, this->members_.m_start.m_last); - this->priv_destroy_range(this->members_.m_finish.m_first, this->members_.m_finish.m_cur); - this->priv_deallocate_node(this->members_.m_finish.m_first); + this->priv_destroy_range(this->members_.m_start.m_cur, this->members_.m_start.get_last()); + this->priv_destroy_range(this->members_.m_finish.get_first(), this->members_.m_finish.m_cur); + this->priv_deallocate_node(this->members_.m_finish.get_first()); } else this->priv_destroy_range(this->members_.m_start.m_cur, this->members_.m_finish.m_cur); @@ -1879,56 +2319,80 @@ class deque : protected deque_base::type, //! Effects: Returns true if x and y are equal //! //! Complexity: Linear to the number of elements in the container. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator==(const deque& x, const deque& y) { return x.size() == y.size() && ::boost::container::algo_equal(x.begin(), x.end(), y.begin()); } //! Effects: Returns true if x and y are unequal //! //! Complexity: Linear to the number of elements in the container. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator!=(const deque& x, const deque& y) { return !(x == y); } //! Effects: Returns true if x is less than y //! //! Complexity: Linear to the number of elements in the container. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator<(const deque& x, const deque& y) { return ::boost::container::algo_lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); } //! Effects: Returns true if x is greater than y //! //! Complexity: Linear to the number of elements in the container. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator>(const deque& x, const deque& y) { return y < x; } //! Effects: Returns true if x is equal or less than y //! //! Complexity: Linear to the number of elements in the container. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator<=(const deque& x, const deque& y) { return !(y < x); } //! Effects: Returns true if x is equal or greater than y //! //! Complexity: Linear to the number of elements in the container. - BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_CONTAINER_FORCEINLINE + BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline friend bool operator>=(const deque& x, const deque& y) { return !(x < y); } //! Effects: x.swap(y) //! //! Complexity: Constant. - BOOST_CONTAINER_FORCEINLINE friend void swap(deque& x, deque& y) + inline friend void swap(deque& x, deque& y) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT(x.swap(y))) { x.swap(y); } #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED private: - BOOST_CONTAINER_FORCEINLINE size_type priv_index_of(const_iterator p) const + void priv_move_assign(BOOST_RV_REF(deque) x, dtl::bool_ /*steal_resources*/) + { + //Destroy objects but retain memory in case x reuses it in the future + this->clear(); + //Move allocator if needed + dtl::bool_ flag; + dtl::move_alloc(this->alloc(), x.alloc(), flag); + dtl::move_alloc(this->ptr_alloc(), x.ptr_alloc(), flag); + //Nothrow swap + this->swap_members(x); + } + + void priv_move_assign(BOOST_RV_REF(deque) x, dtl::bool_ /*steal_resources*/) + { + //We can't guarantee a compile-time equal allocator or propagation so fallback to runtime + //Resources can be transferred if both allocators are equal + if (this->alloc() == x.alloc()) { + this->priv_move_assign(boost::move(x), dtl::true_()); + } + else { + this->assign(boost::make_move_iterator(x.begin()), boost::make_move_iterator(x.end())); + } + } + + inline size_type priv_index_of(const_iterator p) const { BOOST_ASSERT(this->cbegin() <= p); BOOST_ASSERT(p <= this->cend()); @@ -1954,12 +2418,12 @@ class deque : protected deque_base::type, throw_out_of_range("deque::at out of range"); } - BOOST_CONTAINER_FORCEINLINE bool priv_in_range(const_iterator pos) const + inline bool priv_in_range(const_iterator pos) const { return (this->begin() <= pos) && (pos < this->end()); } - BOOST_CONTAINER_FORCEINLINE bool priv_in_range_or_end(const_iterator pos) const + inline bool priv_in_range_or_end(const_iterator pos) const { return (this->begin() <= pos) && (pos <= this->end()); } @@ -2013,37 +2477,38 @@ class deque : protected deque_base::type, } } - BOOST_CONTAINER_FORCEINLINE bool priv_push_back_simple_available() const + inline bool priv_push_back_simple_available() const { return this->members_.m_map && - (this->members_.m_finish.m_cur != (this->members_.m_finish.m_last - 1)); + (this->members_.m_finish.m_cur != (this->members_.m_finish.get_last() - 1)); } - BOOST_CONTAINER_FORCEINLINE T *priv_push_back_simple_pos() const + inline T *priv_push_back_simple_pos() const { return boost::movelib::to_raw_pointer(this->members_.m_finish.m_cur); } - BOOST_CONTAINER_FORCEINLINE void priv_push_back_simple_commit() + inline void priv_push_back_simple_commit() { ++this->members_.m_finish.m_cur; } - BOOST_CONTAINER_FORCEINLINE bool priv_push_front_simple_available() const + inline bool priv_push_front_simple_available() const { return this->members_.m_map && - (this->members_.m_start.m_cur != this->members_.m_start.m_first); + (this->members_.m_start.m_cur != this->members_.m_start.get_first()); } - BOOST_CONTAINER_FORCEINLINE T *priv_push_front_simple_pos() const + inline T *priv_push_front_simple_pos() const { return boost::movelib::to_raw_pointer(this->members_.m_start.m_cur) - 1; } - BOOST_CONTAINER_FORCEINLINE void priv_push_front_simple_commit() + inline void priv_push_front_simple_commit() { --this->members_.m_start.m_cur; } void priv_destroy_range(iterator p, iterator p2) { - if(!Base::traits_t::trivial_dctr){ + (void)p; (void)p2; + BOOST_IF_CONSTEXPR(!Base::traits_t::trivial_dctr){ for(;p != p2; ++p){ allocator_traits_type::destroy(this->alloc(), boost::movelib::iterator_to_raw_pointer(p)); } @@ -2052,7 +2517,8 @@ class deque : protected deque_base::type, void priv_destroy_range(pointer p, pointer p2) { - if(!Base::traits_t::trivial_dctr){ + (void)p; (void)p2; + BOOST_IF_CONSTEXPR(!Base::traits_t::trivial_dctr){ for(;p != p2; ++p){ allocator_traits_type::destroy(this->alloc(), boost::movelib::iterator_to_raw_pointer(p)); } @@ -2060,84 +2526,117 @@ class deque : protected deque_base::type, } template - iterator priv_insert_aux_impl(const_iterator p, size_type n, InsertProxy proxy) + iterator priv_insert_middle_aux_impl(const_iterator p, const size_type elemsbefore, const size_type length, const size_type n, InsertProxy proxy) { - iterator pos(p.unconst()); - const size_type pos_n = size_type(p - this->cbegin()); - if(!this->members_.m_map){ + if (!this->members_.m_map) { this->priv_initialize_map(0); - pos = this->begin(); + p = this->cbegin(); } - const size_type elemsbefore = static_cast(pos - this->members_.m_start); - const size_type length = this->size(); + iterator pos(p.unconst()); + const size_type pos_n = size_type(p - this->cbegin()); + if (elemsbefore < length / 2) { const iterator new_start = this->priv_reserve_elements_at_front(n); const iterator old_start = this->members_.m_start; - if(!elemsbefore){ - proxy.uninitialized_copy_n_and_update(this->alloc(), new_start, n); - this->members_.m_start = new_start; - } - else{ - pos = this->members_.m_start + difference_type(elemsbefore); - if (elemsbefore >= n) { - const iterator start_n = this->members_.m_start + difference_type(n); + pos = this->members_.m_start + difference_type(elemsbefore); + if (elemsbefore >= n) { + const iterator start_n = this->members_.m_start + difference_type(n); + BOOST_CONTAINER_TRY { ::boost::container::uninitialized_move_alloc (this->alloc(), this->members_.m_start, start_n, new_start); - this->members_.m_start = new_start; - boost::container::move(start_n, pos, old_start); - proxy.copy_n_and_update(this->alloc(), pos - difference_type(n), n); } - else { - const size_type mid_count = n - elemsbefore; - const iterator mid_start = old_start - difference_type(mid_count); + BOOST_CONTAINER_CATCH(...) { + this->priv_destroy_nodes(new_start.m_node, this->members_.m_start.m_node); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END + this->members_.m_start = new_start; + boost::container::move(start_n, pos, old_start); + proxy.copy_n_and_update(this->alloc(), pos - difference_type(n), n); + } + else { + const size_type mid_count = n - elemsbefore; + const iterator mid_start = old_start - difference_type(mid_count); + BOOST_CONTAINER_TRY { proxy.uninitialized_copy_n_and_update(this->alloc(), mid_start, mid_count); this->members_.m_start = mid_start; - ::boost::container::uninitialized_move_alloc - (this->alloc(), old_start, pos, new_start); - this->members_.m_start = new_start; - proxy.copy_n_and_update(this->alloc(), old_start, elemsbefore); + ::boost::container::uninitialized_move_alloc(this->alloc(), old_start, pos, new_start); + } + BOOST_CONTAINER_CATCH(...) { + this->priv_destroy_nodes(new_start.m_node, this->members_.m_start.m_node); + BOOST_CONTAINER_RETHROW } + BOOST_CONTAINER_CATCH_END + this->members_.m_start = new_start; + proxy.copy_n_and_update(this->alloc(), old_start, elemsbefore); } } else { const iterator new_finish = this->priv_reserve_elements_at_back(n); const iterator old_finish = this->members_.m_finish; const size_type elemsafter = length - elemsbefore; - if(!elemsafter){ - proxy.uninitialized_copy_n_and_update(this->alloc(), old_finish, n); + + pos = old_finish - difference_type(elemsafter); + if (elemsafter >= n) { + iterator finish_n = old_finish - difference_type(n); + BOOST_CONTAINER_TRY { + ::boost::container::uninitialized_move_alloc(this->alloc(), finish_n, old_finish, old_finish); + } + BOOST_CONTAINER_CATCH(...) { + this->priv_destroy_nodes(this->members_.m_finish.m_node + 1, new_finish.m_node + 1); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END + this->members_.m_finish = new_finish; + boost::container::move_backward(pos, finish_n, old_finish); + proxy.copy_n_and_update(this->alloc(), pos, n); } - else{ - pos = old_finish - difference_type(elemsafter); - if (elemsafter >= n) { - iterator finish_n = old_finish - difference_type(n); - ::boost::container::uninitialized_move_alloc - (this->alloc(), finish_n, old_finish, old_finish); - this->members_.m_finish = new_finish; - boost::container::move_backward(pos, finish_n, old_finish); - proxy.copy_n_and_update(this->alloc(), pos, n); - } - else { - const size_type raw_gap = n - elemsafter; + else { + const size_type raw_gap = n - elemsafter; + BOOST_CONTAINER_TRY{ ::boost::container::uninitialized_move_alloc (this->alloc(), pos, old_finish, old_finish + difference_type(raw_gap)); BOOST_CONTAINER_TRY{ proxy.copy_n_and_update(this->alloc(), pos, elemsafter); proxy.uninitialized_copy_n_and_update(this->alloc(), old_finish, raw_gap); } - BOOST_CONTAINER_CATCH(...){ + BOOST_CONTAINER_CATCH(...) { this->priv_destroy_range(old_finish, old_finish + difference_type(elemsafter)); BOOST_CONTAINER_RETHROW } BOOST_CONTAINER_CATCH_END - this->members_.m_finish = new_finish; } + BOOST_CONTAINER_CATCH(...) { + this->priv_destroy_nodes(this->members_.m_finish.m_node + 1, new_finish.m_node + 1); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END + this->members_.m_finish = new_finish; } } return this->begin() + difference_type(pos_n); } + template + iterator priv_insert_aux_impl(const_iterator p, size_type n, InsertProxy proxy) + { + iterator pos(p.unconst()); + const size_type elemsbefore = static_cast(pos - this->members_.m_start); + const size_type length = this->size(); + + if (!elemsbefore) { + return this->priv_insert_front_aux_impl(n, proxy); + } + else if (elemsbefore == length) { + return this->priv_insert_back_aux_impl(n, proxy); + } + else { + return this->priv_insert_middle_aux_impl(p, elemsbefore, length, n, proxy); + } + } + template iterator priv_insert_back_aux_impl(size_type n, InsertProxy proxy) { @@ -2146,8 +2645,14 @@ class deque : protected deque_base::type, } iterator new_finish = this->priv_reserve_elements_at_back(n); - iterator old_finish = this->members_.m_finish; - proxy.uninitialized_copy_n_and_update(this->alloc(), old_finish, n); + BOOST_CONTAINER_TRY{ + proxy.uninitialized_copy_n_and_update(this->alloc(), this->members_.m_finish, n); + } + BOOST_CONTAINER_CATCH(...) { + this->priv_destroy_nodes(this->members_.m_finish.m_node + 1, new_finish.m_node + 1); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END this->members_.m_finish = new_finish; return iterator(this->members_.m_finish - difference_type(n)); } @@ -2160,12 +2665,20 @@ class deque : protected deque_base::type, } iterator new_start = this->priv_reserve_elements_at_front(n); - proxy.uninitialized_copy_n_and_update(this->alloc(), new_start, n); + BOOST_CONTAINER_TRY{ + proxy.uninitialized_copy_n_and_update(this->alloc(), new_start, n); + } + BOOST_CONTAINER_CATCH(...) { + this->priv_destroy_nodes(new_start.m_node, this->members_.m_start.m_node); + BOOST_CONTAINER_RETHROW + } + BOOST_CONTAINER_CATCH_END + this->members_.m_start = new_start; return new_start; } - BOOST_CONTAINER_FORCEINLINE iterator priv_fill_insert(const_iterator pos, size_type n, const value_type& x) + inline iterator priv_fill_insert(const_iterator pos, size_type n, const value_type& x) { return this->insert(pos, c_it(x, n), c_it()); } @@ -2181,7 +2694,7 @@ class deque : protected deque_base::type, (this->alloc(), *cur, *cur + get_block_ssize(), value); } boost::container::uninitialized_fill_alloc - (this->alloc(), this->members_.m_finish.m_first, this->members_.m_finish.m_cur, value); + (this->alloc(), this->members_.m_finish.get_first(), this->members_.m_finish.m_cur, value); } BOOST_CONTAINER_CATCH(...){ this->priv_destroy_range(this->members_.m_start, iterator(*cur, cur, get_block_size())); @@ -2220,7 +2733,7 @@ class deque : protected deque_base::type, ::boost::container::uninitialized_copy_alloc(this->alloc(), first, mid, *cur_node); first = mid; } - ::boost::container::uninitialized_copy_alloc(this->alloc(), first, last, this->members_.m_finish.m_first); + ::boost::container::uninitialized_copy_alloc(this->alloc(), first, last, this->members_.m_finish.get_first()); } BOOST_CONTAINER_CATCH(...){ this->priv_destroy_range(this->members_.m_start, iterator(*cur_node, cur_node, get_block_size())); @@ -2229,21 +2742,21 @@ class deque : protected deque_base::type, BOOST_CONTAINER_CATCH_END } - // Called only if this->members_.m_finish.m_cur == this->members_.m_finish.m_first. + // Called only if this->members_.m_finish.m_cur == this->members_.m_finish.get_first(). void priv_pop_back_aux() BOOST_NOEXCEPT_OR_NOTHROW { - this->priv_deallocate_node(this->members_.m_finish.m_first); + this->priv_deallocate_node(this->members_.m_finish.get_first()); this->members_.m_finish.priv_set_node(this->members_.m_finish.m_node - 1, get_block_size()); - this->members_.m_finish.m_cur = this->members_.m_finish.m_last - 1; + this->members_.m_finish.m_cur = this->members_.m_finish.get_last() - 1; allocator_traits_type::destroy ( this->alloc() , boost::movelib::to_raw_pointer(this->members_.m_finish.m_cur) ); } - // Called only if this->members_.m_start.m_cur == this->members_.m_start.m_last - 1. Note that + // Called only if this->members_.m_start.m_cur == this->members_.m_start.get_last() - 1. Note that // if the deque has at least one element (a precondition for this member - // function), and if this->members_.m_start.m_cur == this->members_.m_start.m_last, then the deque + // function), and if this->members_.m_start.m_cur == this->members_.m_start.get_last(), then the deque // must have at least two nodes. void priv_pop_front_aux() BOOST_NOEXCEPT_OR_NOTHROW { @@ -2251,14 +2764,14 @@ class deque : protected deque_base::type, ( this->alloc() , boost::movelib::to_raw_pointer(this->members_.m_start.m_cur) ); - this->priv_deallocate_node(this->members_.m_start.m_first); + this->priv_deallocate_node(this->members_.m_start.get_first()); this->members_.m_start.priv_set_node(this->members_.m_start.m_node + 1, get_block_size()); - this->members_.m_start.m_cur = this->members_.m_start.m_first; + this->members_.m_start.m_cur = this->members_.m_start.get_first(); } iterator priv_reserve_elements_at_front(size_type n) { - size_type vacancies = size_type(this->members_.m_start.m_cur - this->members_.m_start.m_first); + size_type vacancies = size_type(this->members_.m_start.m_cur - this->members_.m_start.get_first()); if (n > vacancies){ size_type new_elems = n-vacancies; size_type new_nodes = (new_elems + get_block_size() - 1u) / get_block_size(); @@ -2283,7 +2796,7 @@ class deque : protected deque_base::type, iterator priv_reserve_elements_at_back(size_type n) { - size_type vacancies = size_type(this->members_.m_finish.m_last - this->members_.m_finish.m_cur - 1); + size_type vacancies = size_type(this->members_.m_finish.get_last() - this->members_.m_finish.m_cur - 1); if (n > vacancies){ size_type new_elems = size_type(n - vacancies); size_type new_nodes = size_type(new_elems + get_block_size() - 1u)/get_block_size(); @@ -2348,7 +2861,8 @@ template deque(InputIterator, InputIterator, Allocator const&) -> deque::value_type, Allocator>; #endif -}} +} //namespace container +} //namespace boost #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -2361,7 +2875,7 @@ struct has_trivial_destructor_after_move::allocator_type allocator_type; typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value && ::boost::has_trivial_destructor_after_move::value; }; diff --git a/highlight-wrapper/boost/container/detail/adaptive_node_pool.hpp b/highlight-wrapper/boost/container/detail/adaptive_node_pool.hpp index 9dd89b13..816b95d1 100644 --- a/highlight-wrapper/boost/container/detail/adaptive_node_pool.hpp +++ b/highlight-wrapper/boost/container/detail/adaptive_node_pool.hpp @@ -76,7 +76,7 @@ class private_adaptive_node_pool private_adaptive_node_pool &operator=(const private_adaptive_node_pool &); public: - static const std::size_t nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock; //!Constructor. Never throws private_adaptive_node_pool() diff --git a/highlight-wrapper/boost/container/detail/adaptive_node_pool_impl.hpp b/highlight-wrapper/boost/container/detail/adaptive_node_pool_impl.hpp index e3400977..119b5b61 100644 --- a/highlight-wrapper/boost/container/detail/adaptive_node_pool_impl.hpp +++ b/highlight-wrapper/boost/container/detail/adaptive_node_pool_impl.hpp @@ -49,10 +49,10 @@ namespace container { namespace adaptive_pool_flag { -static const unsigned int none = 0u; -static const unsigned int align_only = 1u << 0u; -static const unsigned int size_ordered = 1u << 1u; -static const unsigned int address_ordered = 1u << 2u; +BOOST_CONTAINER_CONSTANT_VAR unsigned int none = 0u; +BOOST_CONTAINER_CONSTANT_VAR unsigned int align_only = 1u << 0u; +BOOST_CONTAINER_CONSTANT_VAR unsigned int size_ordered = 1u << 1u; +BOOST_CONTAINER_CONSTANT_VAR unsigned int address_ordered = 1u << 2u; } //namespace adaptive_pool_flag{ @@ -213,11 +213,11 @@ template block_container_traits_t; typedef typename block_container_traits_t::hook_t hook_t; typedef hdr_offset_holder_t hdr_offset_holder; - static const unsigned int order_flags = Flags & (adaptive_pool_flag::size_ordered | adaptive_pool_flag::address_ordered); + BOOST_STATIC_CONSTEXPR unsigned int order_flags = Flags & (adaptive_pool_flag::size_ordered | adaptive_pool_flag::address_ordered); typedef MultiallocationChain free_nodes_t; struct block_info_t @@ -253,11 +253,11 @@ template< std::size_t alignment , std::size_t overhead_percent> struct candidate_power_of_2_ct_helper { - static const std::size_t hdr_subblock_elements_alone = (alignment - hdr_size - payload_per_allocation)/real_node_size; - static const std::size_t hdr_subblock_elements_first = (alignment - hdr_size - payload_per_allocation)/real_node_size; - static const std::size_t elements_per_b_subblock_mid = (alignment - hdr_offset_size)/real_node_size; - static const std::size_t elements_per_b_subblock_end = (alignment - hdr_offset_size - payload_per_allocation)/real_node_size; - static const std::size_t num_b_subblock = + BOOST_STATIC_CONSTEXPR std::size_t hdr_subblock_elements_alone = (alignment - hdr_size - payload_per_allocation)/real_node_size; + BOOST_STATIC_CONSTEXPR std::size_t hdr_subblock_elements_first = (alignment - hdr_size - payload_per_allocation)/real_node_size; + BOOST_STATIC_CONSTEXPR std::size_t elements_per_b_subblock_mid = (alignment - hdr_offset_size)/real_node_size; + BOOST_STATIC_CONSTEXPR std::size_t elements_per_b_subblock_end = (alignment - hdr_offset_size - payload_per_allocation)/real_node_size; + BOOST_STATIC_CONSTEXPR std::size_t num_b_subblock = hdr_subblock_elements_alone >= min_elements_per_block ? 0 : ( ((hdr_subblock_elements_first + elements_per_b_subblock_end) >= min_elements_per_block) @@ -266,18 +266,18 @@ struct candidate_power_of_2_ct_helper ) ; - static const std::size_t num_b_subblock_mid = (num_b_subblock > 1) ? (num_b_subblock - 1) : 0; + BOOST_STATIC_CONSTEXPR std::size_t num_b_subblock_mid = (num_b_subblock > 1) ? (num_b_subblock - 1) : 0; - static const std::size_t total_nodes = (num_b_subblock == 0) + BOOST_STATIC_CONSTEXPR std::size_t total_nodes = (num_b_subblock == 0) ? hdr_subblock_elements_alone : ( (num_b_subblock == 1) ? (hdr_subblock_elements_first + elements_per_b_subblock_end) : (hdr_subblock_elements_first + num_b_subblock_mid*elements_per_b_subblock_mid + elements_per_b_subblock_end) ) ; - static const std::size_t total_data = total_nodes*real_node_size; - static const std::size_t total_size = alignment*(num_b_subblock+1); - static const bool overhead_satisfied = (total_size - total_data)*100/total_size < overhead_percent; + BOOST_STATIC_CONSTEXPR std::size_t total_data = total_nodes*real_node_size; + BOOST_STATIC_CONSTEXPR std::size_t total_size = alignment*(num_b_subblock+1); + BOOST_STATIC_CONSTEXPR bool overhead_satisfied = (total_size - total_data)*100/total_size < overhead_percent; }; template< std::size_t initial_alignment @@ -299,7 +299,7 @@ struct candidate_power_of_2_ct , hdr_offset_size , overhead_percent> helper_t; - static const std::size_t candidate_power_of_2 = initial_alignment << std::size_t(!helper_t::overhead_satisfied); + BOOST_STATIC_CONSTEXPR std::size_t candidate_power_of_2 = initial_alignment << std::size_t(!helper_t::overhead_satisfied); typedef typename candidate_power_of_2_ct < candidate_power_of_2 @@ -312,9 +312,9 @@ struct candidate_power_of_2_ct , !helper_t::overhead_satisfied >::type type; - static const std::size_t alignment = type::alignment; - static const std::size_t num_subblocks = type::num_subblocks; - static const std::size_t real_num_node = type::real_num_node; + BOOST_STATIC_CONSTEXPR std::size_t alignment = type::alignment; + BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = type::num_subblocks; + BOOST_STATIC_CONSTEXPR std::size_t real_num_node = type::real_num_node; }; template< std::size_t initial_alignment @@ -354,9 +354,9 @@ struct candidate_power_of_2_ct , hdr_offset_size , overhead_percent> helper_t; - static const std::size_t alignment = initial_alignment; - static const std::size_t num_subblocks = helper_t::num_b_subblock+1; - static const std::size_t real_num_node = helper_t::total_nodes; + BOOST_STATIC_CONSTEXPR std::size_t alignment = initial_alignment; + BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = helper_t::num_b_subblock+1; + BOOST_STATIC_CONSTEXPR std::size_t real_num_node = helper_t::total_nodes; }; ///////////////////////////////////////////// @@ -429,13 +429,13 @@ class private_adaptive_node_pool_impl_common typedef typename SegmentManagerBase::size_type size_type; //Flags //align_only - static const bool AlignOnly = (Flags & adaptive_pool_flag::align_only) != 0; + BOOST_STATIC_CONSTEXPR bool AlignOnly = (Flags & adaptive_pool_flag::align_only) != 0; typedef bool_ IsAlignOnly; typedef true_ AlignOnlyTrue; typedef false_ AlignOnlyFalse; typedef typename SegmentManagerBase::void_pointer void_pointer; - static const typename SegmentManagerBase:: + BOOST_STATIC_CONSTEXPR typename SegmentManagerBase:: size_type PayloadPerAllocation = SegmentManagerBase::PayloadPerAllocation; typedef typename boost::intrusive::pointer_traits @@ -453,9 +453,9 @@ class private_adaptive_node_pool_impl_common typedef typename adaptive_pool_types_t::hdr_offset_holder hdr_offset_holder; typedef private_adaptive_node_pool_impl_common this_type; - static const size_type MaxAlign = alignment_of::value; - static const size_type HdrSize = ((sizeof(block_info_t)-1)/MaxAlign+1)*MaxAlign; - static const size_type HdrOffsetSize = ((sizeof(hdr_offset_holder)-1)/MaxAlign+1)*MaxAlign; + BOOST_STATIC_CONSTEXPR size_type MaxAlign = alignment_of::value; + BOOST_STATIC_CONSTEXPR size_type HdrSize = ((sizeof(block_info_t)-1)/MaxAlign+1)*MaxAlign; + BOOST_STATIC_CONSTEXPR size_type HdrOffsetSize = ((sizeof(hdr_offset_holder)-1)/MaxAlign+1)*MaxAlign; segment_mngr_base_ptr_t mp_segment_mngr_base; //Segment manager block_container_t m_block_container; //Intrusive block list @@ -981,9 +981,9 @@ template< class SizeType , bool AlignOnly> struct calculate_alignment_ct { - static const std::size_t alignment = upper_power_of_2_ct::value; - static const std::size_t num_subblocks = 0; - static const std::size_t real_num_node = (alignment - PayloadPerAllocation - HdrSize)/RealNodeSize; + BOOST_STATIC_CONSTEXPR std::size_t alignment = upper_power_of_2_ct::value; + BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = 0; + BOOST_STATIC_CONSTEXPR std::size_t real_num_node = (alignment - PayloadPerAllocation - HdrSize)/RealNodeSize; }; template< class SizeType @@ -1013,9 +1013,9 @@ struct calculate_alignment_ct , OverheadPercent >::type type; - static const std::size_t alignment = type::alignment; - static const std::size_t num_subblocks = type::num_subblocks; - static const std::size_t real_num_node = type::real_num_node; + BOOST_STATIC_CONSTEXPR std::size_t alignment = type::alignment; + BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = type::num_subblocks; + BOOST_STATIC_CONSTEXPR std::size_t real_num_node = type::real_num_node; }; @@ -1046,17 +1046,17 @@ class private_adaptive_node_pool_impl_ct typedef typename base_t::multiallocation_chain multiallocation_chain; typedef typename base_t::segment_manager_base_type segment_manager_base_type; - static const typename base_t::size_type PayloadPerAllocation = base_t::PayloadPerAllocation; + BOOST_STATIC_CONSTEXPR typename base_t::size_type PayloadPerAllocation = base_t::PayloadPerAllocation; //align_only - static const bool AlignOnly = base_t::AlignOnly; + BOOST_STATIC_CONSTEXPR bool AlignOnly = base_t::AlignOnly; private: - static const size_type MaxAlign = base_t::MaxAlign; - static const size_type HdrSize = base_t::HdrSize; - static const size_type HdrOffsetSize = base_t::HdrOffsetSize; + BOOST_STATIC_CONSTEXPR size_type MaxAlign = base_t::MaxAlign; + BOOST_STATIC_CONSTEXPR size_type HdrSize = base_t::HdrSize; + BOOST_STATIC_CONSTEXPR size_type HdrOffsetSize = base_t::HdrOffsetSize; - static const size_type RealNodeSize = lcm_ct::value>::value; + BOOST_STATIC_CONSTEXPR size_type RealNodeSize = lcm_ct::value>::value; typedef calculate_alignment_ct < size_type, HdrSize, PayloadPerAllocation @@ -1065,9 +1065,9 @@ class private_adaptive_node_pool_impl_ct //Round the size to a power of two value. //This is the total memory size (including payload) that we want to //allocate from the general-purpose allocator - static const size_type NumSubBlocks = data_t::num_subblocks; - static const size_type RealNumNode = data_t::real_num_node; - static const size_type RealBlockAlignment = data_t::alignment; + BOOST_STATIC_CONSTEXPR size_type NumSubBlocks = data_t::num_subblocks; + BOOST_STATIC_CONSTEXPR size_type RealNumNode = data_t::real_num_node; + BOOST_STATIC_CONSTEXPR size_type RealBlockAlignment = data_t::alignment; public: @@ -1165,14 +1165,14 @@ class private_adaptive_node_pool_impl_rt typedef typename impl_t::size_type size_type; typedef typename impl_t::multiallocation_chain multiallocation_chain; - static const typename impl_t::size_type PayloadPerAllocation = impl_t::PayloadPerAllocation; + BOOST_STATIC_CONSTEXPR typename impl_t::size_type PayloadPerAllocation = impl_t::PayloadPerAllocation; //Flags //align_only - static const bool AlignOnly = impl_t::AlignOnly; + BOOST_STATIC_CONSTEXPR bool AlignOnly = impl_t::AlignOnly; - static const size_type HdrSize = impl_t::HdrSize; - static const size_type HdrOffsetSize = impl_t::HdrOffsetSize; + BOOST_STATIC_CONSTEXPR size_type HdrSize = impl_t::HdrSize; + BOOST_STATIC_CONSTEXPR size_type HdrOffsetSize = impl_t::HdrOffsetSize; public: diff --git a/highlight-wrapper/boost/container/detail/advanced_insert_int.hpp b/highlight-wrapper/boost/container/detail/advanced_insert_int.hpp index 0238805d..e16082a7 100644 --- a/highlight-wrapper/boost/container/detail/advanced_insert_int.hpp +++ b/highlight-wrapper/boost/container/detail/advanced_insert_int.hpp @@ -39,6 +39,7 @@ #include #include +#include // other #include @@ -49,19 +50,19 @@ struct move_insert_range_proxy { typedef typename allocator_traits::value_type value_type; - BOOST_CONTAINER_FORCEINLINE explicit move_insert_range_proxy(FwdIt first) + inline explicit move_insert_range_proxy(FwdIt first) : first_(first) {} template - BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) + inline void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) { this->first_ = ::boost::container::uninitialized_move_alloc_n_source (a, this->first_, n, p); } template - BOOST_CONTAINER_FORCEINLINE void copy_n_and_update(Allocator &, Iterator p, std::size_t n) + inline void copy_n_and_update(Allocator &, Iterator p, std::size_t n) { this->first_ = ::boost::container::move_n_source(this->first_, n, p); } @@ -75,18 +76,18 @@ struct insert_range_proxy { typedef typename allocator_traits::value_type value_type; - BOOST_CONTAINER_FORCEINLINE explicit insert_range_proxy(FwdIt first) + inline explicit insert_range_proxy(FwdIt first) : first_(first) {} template - BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) + inline void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) { this->first_ = ::boost::container::uninitialized_copy_alloc_n_source(a, this->first_, n, p); } template - BOOST_CONTAINER_FORCEINLINE void copy_n_and_update(Allocator &, Iterator p, std::size_t n) + inline void copy_n_and_update(Allocator &, Iterator p, std::size_t n) { this->first_ = ::boost::container::copy_n_source(this->first_, n, p); } @@ -100,16 +101,16 @@ struct insert_n_copies_proxy { typedef typename allocator_traits::value_type value_type; - BOOST_CONTAINER_FORCEINLINE explicit insert_n_copies_proxy(const value_type &v) + inline explicit insert_n_copies_proxy(const value_type &v) : v_(v) {} template - BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const + inline void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const { boost::container::uninitialized_fill_alloc_n(a, v_, n, p); } template - BOOST_CONTAINER_FORCEINLINE void copy_n_and_update(Allocator &, Iterator p, std::size_t n) const + inline void copy_n_and_update(Allocator &, Iterator p, std::size_t n) const { while (n){ --n; @@ -129,7 +130,7 @@ struct insert_value_initialized_n_proxy typedef typename dtl::aligned_storage::value>::type storage_t; template - BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const + inline void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const { boost::container::uninitialized_value_init_alloc_n(a, n, p); } template @@ -138,8 +139,8 @@ struct insert_value_initialized_n_proxy while (n){ --n; storage_t v; - alloc_traits::construct(a, move_detail::force_ptr(&v)); - value_type *vp = move_detail::force_ptr(&v); + alloc_traits::construct(a, (value_type*)&v); + value_type *vp = move_detail::launder_cast(&v); value_destructor on_exit(a, *vp); (void)on_exit; *p = ::boost::move(*vp); ++p; @@ -155,7 +156,7 @@ struct insert_default_initialized_n_proxy typedef typename dtl::aligned_storage::value>::type storage_t; template - BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const + inline void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const { boost::container::uninitialized_default_init_alloc_n(a, n, p); } template @@ -165,8 +166,8 @@ struct insert_default_initialized_n_proxy while (n){ --n; typename dtl::aligned_storage::value>::type v; - alloc_traits::construct(a, move_detail::force_ptr(&v), default_init); - value_type *vp = move_detail::force_ptr(&v); + alloc_traits::construct(a, (value_type*)&v, default_init); + value_type *vp = move_detail::launder_cast(&v); value_destructor on_exit(a, *vp); (void)on_exit; *p = ::boost::move(*vp); ++p; @@ -181,21 +182,21 @@ struct insert_copy_proxy typedef boost::container::allocator_traits alloc_traits; typedef typename alloc_traits::value_type value_type; - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_copy_proxy(const value_type &v) + inline explicit insert_copy_proxy(const value_type &v) : v_(v) {} template - BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const + inline void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const { BOOST_ASSERT(n == 1); (void)n; alloc_traits::construct( a, boost::movelib::iterator_to_raw_pointer(p), v_); } template - BOOST_CONTAINER_FORCEINLINE void copy_n_and_update(Allocator &, Iterator p, std::size_t n) const + inline void copy_n_and_update(Allocator &, Iterator p, std::size_t n) const { BOOST_ASSERT(n == 1); (void)n; *p = v_; @@ -211,21 +212,21 @@ struct insert_move_proxy typedef boost::container::allocator_traits alloc_traits; typedef typename alloc_traits::value_type value_type; - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_move_proxy(value_type &v) + inline explicit insert_move_proxy(value_type &v) : v_(v) {} template - BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const + inline void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) const { BOOST_ASSERT(n == 1); (void)n; alloc_traits::construct( a, boost::movelib::iterator_to_raw_pointer(p), ::boost::move(v_) ); } template - BOOST_CONTAINER_FORCEINLINE void copy_n_and_update(Allocator &, Iterator p, std::size_t n) const + inline void copy_n_and_update(Allocator &, Iterator p, std::size_t n) const { BOOST_ASSERT(n == 1); (void)n; *p = ::boost::move(v_); @@ -235,13 +236,13 @@ struct insert_move_proxy }; template -BOOST_CONTAINER_FORCEINLINE insert_move_proxy get_insert_value_proxy(BOOST_RV_REF(typename boost::container::iterator_traits::value_type) v) +inline insert_move_proxy get_insert_value_proxy(BOOST_RV_REF(typename boost::container::iterator_traits::value_type) v) { return insert_move_proxy(v); } template -BOOST_CONTAINER_FORCEINLINE insert_copy_proxy get_insert_value_proxy(const typename boost::container::iterator_traits::value_type &v) +inline insert_copy_proxy get_insert_value_proxy(const typename boost::container::iterator_traits::value_type &v) { return insert_copy_proxy(v); } @@ -264,19 +265,19 @@ struct insert_nonmovable_emplace_proxy typedef typename alloc_traits::value_type value_type; typedef typename build_number_seq::type index_tuple_t; - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_nonmovable_emplace_proxy(BOOST_FWD_REF(Args)... args) + inline explicit insert_nonmovable_emplace_proxy(BOOST_FWD_REF(Args)... args) : args_(args...) {} template - BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) + inline void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n) { this->priv_uninitialized_copy_some_and_update(a, index_tuple_t(), p, n); } private: template - BOOST_CONTAINER_FORCEINLINE void priv_uninitialized_copy_some_and_update(Allocator &a, const index_tuple&, Iterator p, std::size_t n) + inline void priv_uninitialized_copy_some_and_update(Allocator &a, const index_tuple&, Iterator p, std::size_t n) { BOOST_ASSERT(n == 1); (void)n; alloc_traits::construct( a, boost::movelib::iterator_to_raw_pointer(p), ::boost::forward(get(this->args_))... ); @@ -295,25 +296,25 @@ struct insert_emplace_proxy typedef typename base_t::value_type value_type; typedef typename base_t::index_tuple_t index_tuple_t; - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy(BOOST_FWD_REF(Args)... args) + inline explicit insert_emplace_proxy(BOOST_FWD_REF(Args)... args) : base_t(::boost::forward(args)...) {} template - BOOST_CONTAINER_FORCEINLINE void copy_n_and_update(Allocator &a, Iterator p, std::size_t n) + inline void copy_n_and_update(Allocator &a, Iterator p, std::size_t n) { this->priv_copy_some_and_update(a, index_tuple_t(), p, n); } private: template - BOOST_CONTAINER_FORCEINLINE void priv_copy_some_and_update(Allocator &a, const index_tuple&, Iterator p, std::size_t n) + inline void priv_copy_some_and_update(Allocator &a, const index_tuple&, Iterator p, std::size_t n) { BOOST_ASSERT(n ==1); (void)n; typename dtl::aligned_storage::value>::type v; - alloc_traits::construct(a, move_detail::force_ptr(&v), ::boost::forward(get(this->args_))...); - value_type *vp = move_detail::force_ptr(&v); + alloc_traits::construct(a, (value_type*)&v, ::boost::forward(get(this->args_))...); + value_type *vp = move_detail::launder_cast(&v); BOOST_CONTAINER_TRY{ *p = ::boost::move(*vp); } @@ -331,9 +332,9 @@ template struct insert_emplace_proxy::value_type> : public insert_move_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy(typename boost::container::allocator_traits::value_type &&v) + inline explicit insert_emplace_proxy(typename boost::container::allocator_traits::value_type &&v) : insert_move_proxy(v) {} }; @@ -348,9 +349,9 @@ struct insert_emplace_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy(const typename boost::container::allocator_traits::value_type &v) + inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) {} }; @@ -359,9 +360,9 @@ template struct insert_emplace_proxy::value_type &> : public insert_copy_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy(const typename boost::container::allocator_traits::value_type &v) + inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) {} }; @@ -372,9 +373,9 @@ struct insert_emplace_proxy : public insert_copy_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy(const typename boost::container::allocator_traits::value_type &v) + inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) {} }; @@ -396,20 +397,20 @@ struct insert_nonmovable_emplace_proxy##N\ typedef boost::container::allocator_traits alloc_traits;\ typedef typename alloc_traits::value_type value_type;\ \ - static const bool single_value = true;\ + BOOST_STATIC_CONSTEXPR bool single_value = true;\ \ - BOOST_CONTAINER_FORCEINLINE explicit insert_nonmovable_emplace_proxy##N(BOOST_MOVE_UREF##N)\ + inline explicit insert_nonmovable_emplace_proxy##N(BOOST_MOVE_UREF##N)\ BOOST_MOVE_COLON##N BOOST_MOVE_FWD_INIT##N {}\ \ template\ - BOOST_CONTAINER_FORCEINLINE void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n)\ + inline void uninitialized_copy_n_and_update(Allocator &a, Iterator p, std::size_t n)\ {\ BOOST_ASSERT(n == 1); (void)n;\ alloc_traits::construct(a, boost::movelib::iterator_to_raw_pointer(p) BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\ }\ \ template\ - BOOST_CONTAINER_FORCEINLINE void copy_n_and_update(Allocator &, Iterator, std::size_t)\ + inline void copy_n_and_update(Allocator &, Iterator, std::size_t)\ { BOOST_ASSERT(false); }\ \ protected:\ @@ -425,18 +426,18 @@ struct insert_emplace_proxy_arg##N\ typedef typename base_t::value_type value_type;\ typedef boost::container::allocator_traits alloc_traits;\ \ - static const bool single_value = true;\ + BOOST_STATIC_CONSTEXPR bool single_value = true;\ \ - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy_arg##N(BOOST_MOVE_UREF##N)\ + inline explicit insert_emplace_proxy_arg##N(BOOST_MOVE_UREF##N)\ : base_t(BOOST_MOVE_FWD##N){}\ \ template\ - BOOST_CONTAINER_FORCEINLINE void copy_n_and_update(Allocator &a, Iterator p, std::size_t n)\ + inline void copy_n_and_update(Allocator &a, Iterator p, std::size_t n)\ {\ BOOST_ASSERT(n == 1); (void)n;\ typename dtl::aligned_storage::value>::type v;\ - alloc_traits::construct(a, move_detail::force_ptr(&v) BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\ - value_type *vp = move_detail::force_ptr(&v);\ + alloc_traits::construct(a, (value_type*)&v BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\ + value_type *vp = move_detail::launder_cast(&v);\ BOOST_CONTAINER_TRY{\ *p = ::boost::move(*vp);\ }\ @@ -459,9 +460,9 @@ template struct insert_emplace_proxy_arg1::value_type> > : public insert_move_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits::value_type &v) + inline explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits::value_type &v) : insert_move_proxy(v) {} }; @@ -470,9 +471,9 @@ template struct insert_emplace_proxy_arg1::value_type> : public insert_copy_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) + inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) {} }; @@ -484,9 +485,9 @@ template struct insert_emplace_proxy_arg1::value_type> : public insert_move_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits::value_type &&v) + inline explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits::value_type &&v) : insert_move_proxy(v) {} }; @@ -500,9 +501,9 @@ struct insert_emplace_proxy_arg1 : public insert_copy_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) + inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) {} }; @@ -511,9 +512,9 @@ template struct insert_emplace_proxy_arg1::value_type &> : public insert_copy_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) + inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) {} }; @@ -524,9 +525,9 @@ struct insert_emplace_proxy_arg1 : public insert_copy_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; - BOOST_CONTAINER_FORCEINLINE explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) + inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) {} }; diff --git a/highlight-wrapper/boost/container/detail/alloc_helpers.hpp b/highlight-wrapper/boost/container/detail/alloc_helpers.hpp index 5ca2ca72..57c59e46 100644 --- a/highlight-wrapper/boost/container/detail/alloc_helpers.hpp +++ b/highlight-wrapper/boost/container/detail/alloc_helpers.hpp @@ -27,30 +27,30 @@ namespace container { namespace dtl { template -BOOST_CONTAINER_FORCEINLINE void swap_alloc(AllocatorType &, AllocatorType &, dtl::false_type) +inline void swap_alloc(AllocatorType &, AllocatorType &, dtl::false_type) BOOST_NOEXCEPT_OR_NOTHROW {} template -BOOST_CONTAINER_FORCEINLINE void swap_alloc(AllocatorType &l, AllocatorType &r, dtl::true_type) +inline void swap_alloc(AllocatorType &l, AllocatorType &r, dtl::true_type) { boost::adl_move_swap(l, r); } template -BOOST_CONTAINER_FORCEINLINE void assign_alloc(AllocatorType &, const AllocatorType &, dtl::false_type) +inline void assign_alloc(AllocatorType &, const AllocatorType &, dtl::false_type) BOOST_NOEXCEPT_OR_NOTHROW {} template -BOOST_CONTAINER_FORCEINLINE void assign_alloc(AllocatorType &l, const AllocatorType &r, dtl::true_type) +inline void assign_alloc(AllocatorType &l, const AllocatorType &r, dtl::true_type) { l = r; } template -BOOST_CONTAINER_FORCEINLINE void move_alloc(AllocatorType &, AllocatorType &, dtl::false_type) +inline void move_alloc(AllocatorType &, AllocatorType &, dtl::false_type) BOOST_NOEXCEPT_OR_NOTHROW {} template -BOOST_CONTAINER_FORCEINLINE void move_alloc(AllocatorType &l, AllocatorType &r, dtl::true_type) +inline void move_alloc(AllocatorType &l, AllocatorType &r, dtl::true_type) { l = ::boost::move(r); } } //namespace dtl { diff --git a/highlight-wrapper/boost/container/detail/allocation_type.hpp b/highlight-wrapper/boost/container/detail/allocation_type.hpp index 1e8aa673..5f0d4b62 100644 --- a/highlight-wrapper/boost/container/detail/allocation_type.hpp +++ b/highlight-wrapper/boost/container/detail/allocation_type.hpp @@ -42,13 +42,13 @@ enum allocation_type_v typedef unsigned int allocation_type; #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED -static const allocation_type allocate_new = (allocation_type)allocate_new_v; -static const allocation_type expand_fwd = (allocation_type)expand_fwd_v; -static const allocation_type expand_bwd = (allocation_type)expand_bwd_v; -static const allocation_type shrink_in_place = (allocation_type)shrink_in_place_v; -static const allocation_type try_shrink_in_place= (allocation_type)try_shrink_in_place_v; -static const allocation_type nothrow_allocation = (allocation_type)nothrow_allocation_v; -static const allocation_type zero_memory = (allocation_type)zero_memory_v; +BOOST_CONTAINER_CONSTANT_VAR allocation_type allocate_new = (allocation_type)allocate_new_v; +BOOST_CONTAINER_CONSTANT_VAR allocation_type expand_fwd = (allocation_type)expand_fwd_v; +BOOST_CONTAINER_CONSTANT_VAR allocation_type expand_bwd = (allocation_type)expand_bwd_v; +BOOST_CONTAINER_CONSTANT_VAR allocation_type shrink_in_place = (allocation_type)shrink_in_place_v; +BOOST_CONTAINER_CONSTANT_VAR allocation_type try_shrink_in_place= (allocation_type)try_shrink_in_place_v; +BOOST_CONTAINER_CONSTANT_VAR allocation_type nothrow_allocation = (allocation_type)nothrow_allocation_v; +BOOST_CONTAINER_CONSTANT_VAR allocation_type zero_memory = (allocation_type)zero_memory_v; } //namespace container { } //namespace boost { diff --git a/highlight-wrapper/boost/container/detail/allocator_version_traits.hpp b/highlight-wrapper/boost/container/detail/allocator_version_traits.hpp index 391f4666..4e83d213 100644 --- a/highlight-wrapper/boost/container/detail/allocator_version_traits.hpp +++ b/highlight-wrapper/boost/container/detail/allocator_version_traits.hpp @@ -46,19 +46,19 @@ struct allocator_version_traits typedef typename boost::container::allocator_traits::size_type size_type; //Node allocation interface - BOOST_CONTAINER_FORCEINLINE static pointer allocate_one(Allocator &a) + inline static pointer allocate_one(Allocator &a) { return a.allocate_one(); } - BOOST_CONTAINER_FORCEINLINE static void deallocate_one(Allocator &a, const pointer &p) + inline static void deallocate_one(Allocator &a, const pointer &p) { a.deallocate_one(p); } - BOOST_CONTAINER_FORCEINLINE static void allocate_individual(Allocator &a, size_type n, multiallocation_chain &m) + inline static void allocate_individual(Allocator &a, size_type n, multiallocation_chain &m) { return a.allocate_individual(n, m); } - BOOST_CONTAINER_FORCEINLINE static void deallocate_individual(Allocator &a, multiallocation_chain &holder) + inline static void deallocate_individual(Allocator &a, multiallocation_chain &holder) { a.deallocate_individual(holder); } - BOOST_CONTAINER_FORCEINLINE static pointer allocation_command(Allocator &a, allocation_type command, + inline static pointer allocation_command(Allocator &a, allocation_type command, size_type limit_size, size_type &prefer_in_recvd_out_size, pointer &reuse) { return a.allocation_command(command, limit_size, prefer_in_recvd_out_size, reuse); } }; @@ -82,10 +82,10 @@ struct allocator_version_traits < multialloc_cached_counted, value_type> multiallocation_chain; //Node allocation interface - BOOST_CONTAINER_FORCEINLINE static pointer allocate_one(Allocator &a) + inline static pointer allocate_one(Allocator &a) { return a.allocate(1); } - BOOST_CONTAINER_FORCEINLINE static void deallocate_one(Allocator &a, const pointer &p) + inline static void deallocate_one(Allocator &a, const pointer &p) { a.deallocate(p, 1); } static void deallocate_individual(Allocator &a, multiallocation_chain &holder) @@ -102,17 +102,17 @@ struct allocator_version_traits struct allocate_individual_rollback { - BOOST_CONTAINER_FORCEINLINE allocate_individual_rollback(Allocator &a, multiallocation_chain &chain) + inline allocate_individual_rollback(Allocator &a, multiallocation_chain &chain) : mr_a(a), mp_chain(&chain) {} - BOOST_CONTAINER_FORCEINLINE ~allocate_individual_rollback() + inline ~allocate_individual_rollback() { if(mp_chain) allocator_version_traits::deallocate_individual(mr_a, *mp_chain); } - BOOST_CONTAINER_FORCEINLINE void release() + inline void release() { mp_chain = 0; } diff --git a/highlight-wrapper/boost/container/detail/block_list.hpp b/highlight-wrapper/boost/container/detail/block_list.hpp index 0ed0e227..48523267 100644 --- a/highlight-wrapper/boost/container/detail/block_list.hpp +++ b/highlight-wrapper/boost/container/detail/block_list.hpp @@ -74,11 +74,11 @@ class block_list_base { list_node m_list; - static const std::size_t MaxAlignMinus1 = memory_resource::max_align-1u; + BOOST_STATIC_CONSTEXPR std::size_t MaxAlignMinus1 = memory_resource::max_align-1u; public: - static const std::size_t header_size = std::size_t(sizeof(DerivedFromBlockListHeader) + MaxAlignMinus1) & std::size_t(~MaxAlignMinus1); + BOOST_STATIC_CONSTEXPR std::size_t header_size = std::size_t(sizeof(DerivedFromBlockListHeader) + MaxAlignMinus1) & std::size_t(~MaxAlignMinus1); explicit block_list_base() { list_algo::init_header(&m_list); } diff --git a/highlight-wrapper/boost/container/detail/block_slist.hpp b/highlight-wrapper/boost/container/detail/block_slist.hpp index 890e7258..b265ba44 100644 --- a/highlight-wrapper/boost/container/detail/block_slist.hpp +++ b/highlight-wrapper/boost/container/detail/block_slist.hpp @@ -68,11 +68,11 @@ class block_slist_base { slist_node m_slist; - static const std::size_t MaxAlignMinus1 = memory_resource::max_align-1u; + BOOST_STATIC_CONSTEXPR std::size_t MaxAlignMinus1 = memory_resource::max_align-1u; public: - static const std::size_t header_size = std::size_t(sizeof(DerivedFromBlockSlistHeader) + MaxAlignMinus1) & std::size_t(~MaxAlignMinus1); + BOOST_STATIC_CONSTEXPR std::size_t header_size = std::size_t(sizeof(DerivedFromBlockSlistHeader) + MaxAlignMinus1) & std::size_t(~MaxAlignMinus1); explicit block_slist_base() { slist_algo::init_header(&m_slist); } diff --git a/highlight-wrapper/boost/container/detail/compare_functors.hpp b/highlight-wrapper/boost/container/detail/compare_functors.hpp index ae4ffcea..9a352740 100644 --- a/highlight-wrapper/boost/container/detail/compare_functors.hpp +++ b/highlight-wrapper/boost/container/detail/compare_functors.hpp @@ -32,11 +32,11 @@ class equal_to_value const value_type &t_; public: - BOOST_CONTAINER_FORCEINLINE explicit equal_to_value(const value_type &t) + inline explicit equal_to_value(const value_type &t) : t_(t) {} - BOOST_CONTAINER_FORCEINLINE bool operator()(const value_type &t)const + inline bool operator()(const value_type &t)const { return t_ == t; } }; @@ -47,39 +47,39 @@ struct value_to_node_compare typedef Pred predicate_type; typedef Node node_type; - BOOST_CONTAINER_FORCEINLINE value_to_node_compare() + inline value_to_node_compare() : Pred() {} - BOOST_CONTAINER_FORCEINLINE explicit value_to_node_compare(Pred pred) + inline explicit value_to_node_compare(Pred pred) : Pred(pred) {} - BOOST_CONTAINER_FORCEINLINE Ret operator()(const Node &a, const Node &b) const + inline Ret operator()(const Node &a, const Node &b) const { return static_cast(*this)(a.get_data(), b.get_data()); } - BOOST_CONTAINER_FORCEINLINE Ret operator()(const Node &a) const + inline Ret operator()(const Node &a) const { return static_cast(*this)(a.get_data()); } - BOOST_CONTAINER_FORCEINLINE Ret operator()(const Node &a, const Node &b) + inline Ret operator()(const Node &a, const Node &b) { return static_cast(*this)(a.get_data(), b.get_data()); } - BOOST_CONTAINER_FORCEINLINE Ret operator()(const Node &a) + inline Ret operator()(const Node &a) { return static_cast(*this)(a.get_data()); } - BOOST_CONTAINER_FORCEINLINE predicate_type & predicate() { return static_cast(*this); } - BOOST_CONTAINER_FORCEINLINE const predicate_type & predicate() const { return static_cast(*this); } + inline predicate_type & predicate() { return static_cast(*this); } + inline const predicate_type & predicate() const { return static_cast(*this); } }; template struct key_node_pred : public boost::intrusive::detail::ebo_functor_holder { - BOOST_CONTAINER_FORCEINLINE explicit key_node_pred(const KeyPred &comp) + inline explicit key_node_pred(const KeyPred &comp) : base_t(comp) {} - BOOST_CONTAINER_FORCEINLINE explicit key_node_pred() + inline explicit key_node_pred() {} typedef boost::intrusive::detail::ebo_functor_holder base_t; @@ -88,42 +88,42 @@ struct key_node_pred typedef typename KeyOfValue::type key_type; - BOOST_CONTAINER_FORCEINLINE static const key_type &key_from(const Node &n) + inline static const key_type &key_from(const Node &n) { return key_of_value()(n.get_data()); } template - BOOST_CONTAINER_FORCEINLINE static const T & + inline static const T & key_from(const T &t) { return t; } - BOOST_CONTAINER_FORCEINLINE const key_predicate &key_pred() const + inline const key_predicate &key_pred() const { return static_cast(*this); } - BOOST_CONTAINER_FORCEINLINE key_predicate &key_pred() + inline key_predicate &key_pred() { return static_cast(*this); } - BOOST_CONTAINER_FORCEINLINE Ret operator()(const key_type &key) const + inline Ret operator()(const key_type &key) const { return this->key_pred()(key); } template - BOOST_CONTAINER_FORCEINLINE Ret operator()(const U &nonkey) const + inline Ret operator()(const U &nonkey) const { return this->key_pred()(this->key_from(nonkey)); } - BOOST_CONTAINER_FORCEINLINE bool operator()(const key_type &key1, const key_type &key2) const + inline bool operator()(const key_type &key1, const key_type &key2) const { return this->key_pred()(key1, key2); } template - BOOST_CONTAINER_FORCEINLINE bool operator()(const key_type &key1, const U &nonkey2) const + inline bool operator()(const key_type &key1, const U &nonkey2) const { return this->key_pred()(key1, this->key_from(nonkey2)); } template - BOOST_CONTAINER_FORCEINLINE bool operator()(const U &nonkey1, const key_type &key2) const + inline bool operator()(const U &nonkey1, const key_type &key2) const { return this->key_pred()(this->key_from(nonkey1), key2); } template - BOOST_CONTAINER_FORCEINLINE bool operator()(const U &nonkey1, const V &nonkey2) const + inline bool operator()(const U &nonkey1, const V &nonkey2) const { return this->key_pred()(this->key_from(nonkey1), this->key_from(nonkey2)); } }; diff --git a/highlight-wrapper/boost/container/detail/config_begin.hpp b/highlight-wrapper/boost/container/detail/config_begin.hpp index e1075d1d..d459a066 100644 --- a/highlight-wrapper/boost/container/detail/config_begin.hpp +++ b/highlight-wrapper/boost/container/detail/config_begin.hpp @@ -41,6 +41,7 @@ #pragma warning (disable : 4671) // the copy constructor is inaccessible #pragma warning (disable : 4673) // throwing '' the following types will not be considered at the catch site #pragma warning (disable : 4675) // "method" should be declared "static" and have exactly one parameter + #pragma warning (disable : 4702) // unreachable code #pragma warning (disable : 4706) // assignment within conditional expression #pragma warning (disable : 4710) // function not inlined #pragma warning (disable : 4714) // "function": marked as __forceinline not inlined diff --git a/highlight-wrapper/boost/container/detail/construct_in_place.hpp b/highlight-wrapper/boost/container/detail/construct_in_place.hpp index d824d814..bfdf05c2 100644 --- a/highlight-wrapper/boost/container/detail/construct_in_place.hpp +++ b/highlight-wrapper/boost/container/detail/construct_in_place.hpp @@ -24,6 +24,7 @@ #include #include #include +#include namespace boost { namespace container { @@ -62,9 +63,42 @@ BOOST_CONTAINER_FORCEINLINE void construct_in_place(Allocator &a, T *dest, empla //Assignment +template +BOOST_CONTAINER_FORCEINLINE + typename dtl::disable_if_c + < dtl::is_pair::type>::value + && dtl::is_pair::type>::value + , void>::type +assign_in_place_ref(T &t, BOOST_FWD_REF(U) u) +{ t = ::boost::forward(u); } + +template +BOOST_CONTAINER_FORCEINLINE + typename dtl::enable_if_c + < dtl::is_pair::type>::value + && dtl::is_pair::type>::value + , void>::type +assign_in_place_ref(T &t, const U &u) +{ + assign_in_place_ref(t.first, u.first); + assign_in_place_ref(t.second, u.second); +} + +template +BOOST_CONTAINER_FORCEINLINE + typename dtl::enable_if_c + < dtl::is_pair::type>::value + && dtl::is_pair::type>::value + , void>::type +assign_in_place_ref(T &t, BOOST_RV_REF(U) u) +{ + assign_in_place_ref(t.first, ::boost::move(u.first)); + assign_in_place_ref(t.second, ::boost::move(u.second)); +} + template BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, InpIt source) -{ *dest = *source; } +{ assign_in_place_ref(*dest, *source); } template BOOST_CONTAINER_FORCEINLINE void assign_in_place(DstIt dest, value_init_construct_iterator) diff --git a/highlight-wrapper/boost/container/detail/container_or_allocator_rebind.hpp b/highlight-wrapper/boost/container/detail/container_or_allocator_rebind.hpp index 1525e41d..e6f27b25 100644 --- a/highlight-wrapper/boost/container/detail/container_or_allocator_rebind.hpp +++ b/highlight-wrapper/boost/container/detail/container_or_allocator_rebind.hpp @@ -38,8 +38,7 @@ struct container_or_allocator_rebind_impl template struct container_or_allocator_rebind_impl - : real_allocator -{}; +{ typedef void type; }; template struct container_or_allocator_rebind diff --git a/highlight-wrapper/boost/container/detail/container_rebind.hpp b/highlight-wrapper/boost/container/detail/container_rebind.hpp index 854291ae..4c34209f 100644 --- a/highlight-wrapper/boost/container/detail/container_rebind.hpp +++ b/highlight-wrapper/boost/container/detail/container_rebind.hpp @@ -26,6 +26,16 @@ namespace boost { namespace container { namespace dtl { + template + struct void_or_portable_rebind_alloc + { + typedef typename allocator_traits::type>::template portable_rebind_alloc::type type; + }; + + template + struct void_or_portable_rebind_alloc + { typedef void type; }; + template struct container_rebind; @@ -34,14 +44,14 @@ namespace dtl { template