constructor)  ](/mwiki/index.php?title=cpp/container/flat_multiset/flat_multiset&action=edit&redlink=1 "cpp/container/flat multiset/flat multiset \(page does not exist\)") (C++23)  |  constructs the ` flat_multiset ` from a range   
(public member function of ` std::flat_multiset<Key,Compare,KeyContainer> ` )  
[ (constructor)  ](/mwiki/index.php?title=cpp/container/flat_multimap/flat_multimap&action=edit&redlink=1 "cpp/container/flat multimap/flat multimap \(page does not exist\)") (C++23)  |  constructs the ` flat_multimap ` from a range   
(public member function of `
std::flat_multimap<Key,T,Compare,KeyContainer,MappedContainer> ` )  
  
#####  Strings library  
  
[ (constructor)  ](/w/cpp/string/basic_string/basic_string "cpp/string/basic string/basic string") (C++23)  |  constructs the ` basic_string ` from a range   
(public member function of ` std::basic_string<CharT,Traits,Allocator> ` )  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/from_range&action=edit&section=2 "Edit
section: Notes") ]  Notes

[ Feature-test ](/w/cpp/utility/feature_test "cpp/utility/feature test") macro  |  Value  |  Std  |  Feature   
---|---|---|---  
[ ` __cpp_lib_containers_ranges ` ](/w/cpp/feature_test#cpp_lib_containers_ranges "cpp/feature test") |  202202L  |  (C++23)  |  Tagged constructors to construct from [ container compatible range ](/w/cpp/ranges/to#container_compatible_range "cpp/ranges/to")  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/from_range&action=edit&section=3 "Edit
section: Example") ]  Example

Run this code

    
    
    #include <cassert>
    #include <string>
     
    int main()
    {
    #ifdef __cpp_lib_containers_ranges
        auto const range = {0x43, 43, 43};
        [std::string](http://en.cppreference.com/w/cpp/string/basic_string) str{std::from_range, range}; // uses tagged constructor
        [assert](http://en.cppreference.com/w/cpp/error/assert)(str == "C++");
    #endif
    }

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/from_range&action=edit&section=4 "Edit
section: See also") ]  See also

[ ranges::to  ](/w/cpp/ranges/to "cpp/ranges/to") (C++23)  |  constructs a new non-view object from an input range   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_to&action=edit)  
---|---  
  
Retrieved from " [
https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/from_range&oldid=161700
](https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/from_range&oldid=161700)
"

#####  Navigation

  * [ Support us ](http://www.cppreference.com/support)
  * [ Recent changes ](/w/Special:RecentChanges "A list of recent changes in the wiki \[r\]")
  * [ FAQ ](/w/Cppreference:FAQ)
  * [ Offline version ](/w/Cppreference:Archives)

#####  Toolbox

  * [ What links here ](/w/Special:WhatLinksHere/cpp/ranges/from_range "A list of all wiki pages that link here \[j\]")
  * [ Related changes ](/w/Special:RecentChangesLinked/cpp/ranges/from_range "Recent changes in pages linked from this page \[k\]")
  * [ Upload file ](http://upload.cppreference.com/w/Special:Upload "Upload files \[u\]")
  * [ Special pages ](/w/Special:SpecialPages "A list of all special pages \[q\]")
  * [ Printable version ](/mwiki/index.php?title=cpp/ranges/from_range&printable=yes "Printable version of this page \[p\]")
  * [ Permanent link ](/mwiki/index.php?title=cpp/ranges/from_range&oldid=161700 "Permanent link to this revision of the page")
  * [ Page information ](/mwiki/index.php?title=cpp/ranges/from_range&action=info)

  * This page was last modified on 29 October 2023, at 09:24. 
  * This page has been accessed 7,434 times. 

  * [ Privacy policy ](/w/Cppreference:Privacy_policy "Cppreference:Privacy policy")
  * [ About cppreference.com ](/w/Cppreference:About "Cppreference:About")
  * [ Disclaimers ](/w/Cppreference:General_disclaimer "Cppreference:General disclaimer")

  * [ ![Powered by MediaWiki](/mwiki/skins/common/images/poweredby_mediawiki_88x3