[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis page provides documentation for the \u003ccode\u003eLocation\u003c/code\u003e class in the Google Cloud C++ client library, which represents a Cloud location identified by a project ID and location ID.\u003c/p\u003e\n"],["\u003cp\u003eThe most recent release candidate version for the C++ library is version 2.37.0-rc, and the page lists versions dating back to version 2.10.1.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLocation\u003c/code\u003e class provides constructors to create location objects from a \u003ccode\u003eProject\u003c/code\u003e and location ID, or directly from project ID and location ID strings.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLocation\u003c/code\u003e class includes functions to retrieve the associated \u003ccode\u003eProject\u003c/code\u003e, project ID, location ID, and the full location name.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLocation\u003c/code\u003e class is not responsible for validating the given project and location IDs, which is the user's responsibility.\u003c/p\u003e\n"]]],[],null,["# Class Location (2.24.0)\n\nVersion 2.24.0keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1Location)\n- [2.41.0](/cpp/docs/reference/common/2.41.0/classgoogle_1_1cloud_1_1Location)\n- [2.40.0](/cpp/docs/reference/common/2.40.0/classgoogle_1_1cloud_1_1Location)\n- [2.39.0](/cpp/docs/reference/common/2.39.0/classgoogle_1_1cloud_1_1Location)\n- [2.38.0](/cpp/docs/reference/common/2.38.0/classgoogle_1_1cloud_1_1Location)\n- [2.37.0](/cpp/docs/reference/common/2.37.0/classgoogle_1_1cloud_1_1Location)\n- [2.36.0](/cpp/docs/reference/common/2.36.0/classgoogle_1_1cloud_1_1Location)\n- [2.35.0](/cpp/docs/reference/common/2.35.0/classgoogle_1_1cloud_1_1Location)\n- [2.34.0](/cpp/docs/reference/common/2.34.0/classgoogle_1_1cloud_1_1Location)\n- [2.33.0](/cpp/docs/reference/common/2.33.0/classgoogle_1_1cloud_1_1Location)\n- [2.32.0](/cpp/docs/reference/common/2.32.0/classgoogle_1_1cloud_1_1Location)\n- [2.31.0](/cpp/docs/reference/common/2.31.0/classgoogle_1_1cloud_1_1Location)\n- [2.30.0](/cpp/docs/reference/common/2.30.0/classgoogle_1_1cloud_1_1Location)\n- [2.29.0](/cpp/docs/reference/common/2.29.0/classgoogle_1_1cloud_1_1Location)\n- [2.28.0](/cpp/docs/reference/common/2.28.0/classgoogle_1_1cloud_1_1Location)\n- [2.27.0](/cpp/docs/reference/common/2.27.0/classgoogle_1_1cloud_1_1Location)\n- [2.26.0](/cpp/docs/reference/common/2.26.0/classgoogle_1_1cloud_1_1Location)\n- [2.25.1](/cpp/docs/reference/common/2.25.1/classgoogle_1_1cloud_1_1Location)\n- [2.24.0](/cpp/docs/reference/common/2.24.0/classgoogle_1_1cloud_1_1Location)\n- [2.23.0](/cpp/docs/reference/common/2.23.0/classgoogle_1_1cloud_1_1Location)\n- [2.22.1](/cpp/docs/reference/common/2.22.1/classgoogle_1_1cloud_1_1Location)\n- [2.21.0](/cpp/docs/reference/common/2.21.0/classgoogle_1_1cloud_1_1Location)\n- [2.20.0](/cpp/docs/reference/common/2.20.0/classgoogle_1_1cloud_1_1Location)\n- [2.19.0](/cpp/docs/reference/common/2.19.0/classgoogle_1_1cloud_1_1Location)\n- [2.18.0](/cpp/docs/reference/common/2.18.0/classgoogle_1_1cloud_1_1Location)\n- [2.17.0](/cpp/docs/reference/common/2.17.0/classgoogle_1_1cloud_1_1Location)\n- [2.16.0](/cpp/docs/reference/common/2.16.0/classgoogle_1_1cloud_1_1Location)\n- [2.15.1](/cpp/docs/reference/common/2.15.1/classgoogle_1_1cloud_1_1Location)\n- [2.14.0](/cpp/docs/reference/common/2.14.0/classgoogle_1_1cloud_1_1Location)\n- [2.13.0](/cpp/docs/reference/common/2.13.0/classgoogle_1_1cloud_1_1Location)\n- [2.12.0](/cpp/docs/reference/common/2.12.0/classgoogle_1_1cloud_1_1Location)\n- [2.11.0](/cpp/docs/reference/common/2.11.0/classgoogle_1_1cloud_1_1Location)\n- [2.10.1](/cpp/docs/reference/common/2.10.1/classgoogle_1_1cloud_1_1Location) \nA representation of a Cloud [Location](/cpp/docs/reference/common/2.24.0/classgoogle_1_1cloud_1_1Location). \nA Cloud location is identified by its `project_id` and `location_id`.\n\n\u003cbr /\u003e\n\n| **Note:** This class makes no effort to validate the components of the location name. It is the application's responsibility to provide valid project and location ids. Passing invalid values will not be checked until the location name is used in an RPC.\nFor more info about locations, see \u003chttps://cloud.google.com/about/locations\u003e\n\n\u003cbr /\u003e\n\nConstructors\n------------\n\n### Location(Location const \\&)\n\nCopy and move\n\n### Location(Location \\&\\&)\n\nCopy and move\n\n### Location(Project, std::string)\n\nConstructs a [Location](/cpp/docs/reference/common/2.24.0/classgoogle_1_1cloud_1_1Location) object identified by the given `project` and `location_id`.\n\n### Location(std::string, std::string)\n\nConstructs a Location_id object identified by the given IDs. \nThis is equivalent to first constructing a [`Project`](/cpp/docs/reference/common/2.24.0/classgoogle_1_1cloud_1_1Project) from the given `project_id` and then calling the [`Location(Project, std::string)`](/cpp/docs/reference/common/2.24.0/classgoogle_1_1cloud_1_1Location#classgoogle_1_1cloud_1_1Location_1abb6f670c08b832799bd5535b6d8b9571) constructor.\n\nOperators\n---------\n\n### operator=(Location const \\&)\n\nCopy and move\n\n### operator=(Location \\&\\&)\n\nCopy and move\n\nFunctions\n---------\n\n### project() const\n\nReturns the [`Project`](/cpp/docs/reference/common/2.24.0/classgoogle_1_1cloud_1_1Project) containing this location.\n\n### project_id() const\n\n### location_id() const\n\nReturns the [Location](/cpp/docs/reference/common/2.24.0/classgoogle_1_1cloud_1_1Location) ID.\n\n### FullName() const\n\nReturns the fully qualified location name as a string of the form: \"projects/"]]