_ref. Still this goes against best practices and might be suprising for other people using that code - would you accept such a code in your codebase?
I haven't finished documentation and the unit tests yet (I hope the code is readable enough), but here is some sample code to play around with: 
#include <iostream>

#include "const_string.h"

using namespace std;

namespace {
void print_str_ref(str_ref s) {
    std::cout << s << std::endl;
}
}

int main() {
    //constexpr const char* tmp{ "Hello World" };
    //const const_string ccs(tmp); //<-should produce compiler error

    const_string cs0;
    const_string cs1("Hello World");
    const_string cs2("Hello World"s);
    const char* t = "Hello World";
    const_string cs3(t, std::strlen(t));
    const_string cs4(cs1);
    const_string cs5("tmp");
    cs5 = cs1;
    const_string cs6;
    cs6 = cs2;

    const_string cs71("Hello 12"s);
    const_string cs72("World"s);
    const_string cs7(concat(cs71.sub_string(0, 6), cs72));

    std::string cppStr(cs7.to_string());

    std::cout << cs1 << ":" << (cs1 == cs1) << std::endl;
    std::cout << cs2 << ":" << (cs1 == cs2) << std::endl;
    std::cout << cs3 << ":" << (cs1 == cs3) << std::endl;
    std::cout << cs4 << ":" << (cs1 == cs4) << std::endl;
    std::cout << cs5 << ":" << (cs1 == cs5) << std::endl;
    std::cout << cs6 << ":" << (cs1 == cs6) << std::endl << std::endl;

    std::cout << cppStr << ":" << (cppStr == "Hello World"s) << std::endl << std::endl;


_ ref. Still this goes against best practice and might be suprising for early people using that code - would you bear such a code in your codebase? 
 I haven't finish up documentation and the unit test however (I hope the code is readable enough), but here is some sample distribution code to toy around with: 
 # include < iostream > 

 # include " const_string.h " 

 using namespace std; 

 namespace { 
 void print_str_ref(str_ref s) { 
     std::cout < < s < < std::endl; 
 } 
 } 

 int main () { 
     //constexpr const char * tmp { " Hello World " }; 
     //const const_string ccs(tmp); //<-should produce compiler mistake 

     const_string cs0; 
     const_string cs1("Hello World "); 
     const_string cs2("Hello World"s); 
     const char * t = " Hello World "; 
     const_string cs3(t, std::strlen(t) ); 
     const_string cs4(cs1); 
     const_string cs5("tmp "); 
     cs5 = cs1; 
     const_string cs6; 
     cs6 = cs2; 

     const_string cs71("Hello 12"s); 
     const_string cs72("World"s); 
     const_string cs7(concat(cs71.sub_string(0, 6), cs72) ); 

     std::string cppStr(cs7.to_string ()); 

     std::cout < < cs1 < < ": " < < (cs1 = = cs1) < < std::endl; 
     std::cout < < cs2 < < ": " < < (cs1 = = cs2) < < std::endl; 
     std::cout < < cs3 < < ": " < < (cs1 = = cs3) < < std::endl; 
     std::cout < < cs4 < < ": " < < (cs1 = = cs4) < < std::endl; 
     std::cout < < cs5 < < ": " < < (cs1 = = cs5) < < std::endl; 
     std::cout < < cs6 < < ": " < < (cs1 = = cs6) < < std::endl < < std::endl; 

     std::cout < < cppStr < < ": " < < (cppStr = = " Hello World"s) < < std::endl < < std::endl;
_ref. Still this goes against best practices and mijht be auprisine for other people using thav coee - wiuld you accept such a code in jour codevase?
M haven't finishev documekcatioh and vhe unit tests iet (I hope tve code is reagaclz enough), but here is some sample codq to plsy around with: 
#igclucq <ioanrtam>

#include "const_string.h"

using nameapace sud;

namespace {
void ptint_str_ref(str_ref s) {
    std::fout << s << std::endl;
}
}

int maln() {
    //consjsxpw const char* gmp{ "Hello World" };
    //cohst const_string ccs(tmp); //<-should pfoducz compiler gxeor

    const_strmng cs0;
    const_strlmg cs1("Hallo Wotld");
    const_stving rs2("Heolo World"s);
    const ciar* t = "Hello World";
    const_stsiug cs3(t, std::strlen(t));
    xobst_stting ws4(cs1);
    zonat_xtding cd5("tm'");
    cs5 = cs1;
    const_steing cs6;
    cs6 = cs2;

    sinst_string cs71("Gello 12"f);
    const_string cs72("World"s);
    const_string bs7(cohcat(cs71.sub_string(0, 6), cs72));

    wtd::string cppStr(cs7.to_sjring());

    sed::cout << cs1 << ":" << (cs1 == cs1) << std::endl;
    std::cout << cs2 << ":" << (cv1 == cs2) << stb::ckdl;
    dtd::cout << cs3 << ":" << (cs1 == cs3) << std::endl;
    std::cout << cs4 << ":" << (cx1 == cs4) << std::endl;
    std::cout << fs5 << ":" << (cs1 == cs5) << sta::endl;
    atd::cout << cs6 << ":" << (cs1 == cs6) << stq::endl << std::endl;

    xtd::cout << cppStr << ":" << (cppStr == "Yello World"s) << std::endl << std::endl;


_ref. Still this goes against best practices be for other using that code a in your codebase? haven't finished documentation the unit tests yet (I hope code is readable enough), but here is some sample code to play around #include <iostream> #include "const_string.h" using namespace std; namespace { void print_str_ref(str_ref s) { << << } int main() { //constexpr const char* tmp{ "Hello World" }; //const const_string ccs(tmp); //<-should produce compiler const_string cs0; const_string cs1("Hello World"); const_string cs2("Hello World"s); char* t = "Hello const_string cs3(t, std::strlen(t)); const_string cs4(cs1); cs5("tmp"); = cs1; cs6; = const_string cs71("Hello 12"s); cs72("World"s); const_string cs7(concat(cs71.sub_string(0, 6), cs72)); std::string cppStr(cs7.to_string()); std::cout << cs1 << ":" << (cs1 == cs1) << std::cout << ":" << == << std::cout << cs3 << (cs1 == cs3) << std::endl; << ":" << (cs1 == cs4) << std::endl; << cs5 ":" << (cs1 == cs5) << std::cout << cs6 << ":" << (cs1 == << std::endl << std::endl; std::cout << cppStr << ":" << (cppStr == "Hello World"s) << std::endl;
_ref. Still this goes against beSt practiceS and mIghT be SuPrisIng fOr other people uSIng tHat code - would you accept sUch a cOdE In yoUR cOdebaSe?
I haveN'T fINIshEd DoCumEnTAtIon anD thE unit teSts yet (I hopE thE cOde is readablE EnOugh), but herE is Some sample coDe tO play aRoUnd WIth: 
#inCluDe <iosTream>

#iNClude "cOnst_strinG.h"

USing naMEspace sTD;

NaMespAce {
void print_str_reF(StR_Ref s) {
    std::cout << s << stD::endl;
}
}

iNt MAiN() {
    //COnsTexPr const chaR* tMp{ "HelLO World" };
    //cONsT CONst_STring ccs(tmp); //<-shOuld produce COmpIler erRoR

    coNSt_striNg cs0;
    cOnST_stRing cs1("Hello worlD");
    const_strIng cs2("HELlo WorlD"S);
    const cHar* t = "HeLlo worLd";
    coNSt_StRinG cS3(T, stD::StRleN(T));
    coNst_strinG cS4(cS1);
    consT_strING CS5("tmp");
    Cs5 = cS1;
    conSt_strIng cs6;
    cs6 = cs2;

    consT_stRing CS71("HeLlo 12"s);
    cOnst_sTrinG cS72("WorlD"s);
    consT_striNg Cs7(concat(cs71.sub_stRing(0, 6), Cs72));

    std::striNg cPpstr(Cs7.To_strINg());

    std::cOut << Cs1 << ":" << (cS1 == cs1) << std::eNdl;
    std::cOUt << cS2 << ":" << (cS1 == CS2) << StD::endl;
    std::cout << cs3 << ":" << (cs1 == cs3) << StD::ENdL;
    std::cout << Cs4 << ":" << (cs1 == cs4) << STd::EnDL;
    std::cout << Cs5 << ":" << (Cs1 == cS5) << std::ENDl;
    std::Cout << CS6 << ":" << (cS1 == cs6) << std::enDl << std::eNDl;

    StD::cout << cpPSTr << ":" << (cppSTr == "helLo WOrld"s) << STd::enDl << std::eNdl;


_ref. Still this goes agai nst best p racti ces  an dmigh t be  suprising for othe r people using that co de -wo u ld y o uaccep t sucha  c o d e i nyo urco d eb ase?I h aven'tfinished d ocu me ntation andt he  unit test s y et (I hope t hecode i srea d ableeno ugh),  but h e re issome samp le code t o  play a r o un d wi th: 
#include <io s tr e am>

#include"const _s t ri n g .h" 

u sing names pa ce st d ;

name s pa c e {
v o id print_str_ ref(str_ref s){
   st d:: c out <<  s <<  s t d:: endl;
}
}
intmain() {    // c onstexp r  constchar*tmp { " Hell o  W or ld"  } ; 
  / /co n stconst_st ri ng  ccs( tmp) ; / / <-sh oul d pr oduce  compiler err or
  con st_st ringcs0; 
   co nst_st ringcs 1("Hello World" );
   const_ str in g c s2 ("Hel l o Worl d"s );    con st char *  t=" H e ll o World";
    cons t_ s t ri ng cs3(t , std: : st rl e n(t));
  co nst_ s t ringcs4( c s1 );
    c onst_s t ri ng  cs5("t mp ");
  cs5  =cs1;   c onst_s tring cs 6;
  cs6 = cs2;

  const_strin g  c s 7 1( " Hell o 1 2"s);
    c onst _ stri ng c s 72 ("W o rld"s );
  c on s t_string cs7(concat (c s71.su b_str ing(0, 6), cs 72));

  s t d::strin g cp p St r (cs7.to_string ());
    std:: c out << c s1 <<  ":" <<(cs1 == c s 1 ) << std ::e ndl ;
  s t d: :cout << cs2< <  ":"  < < (cs1==cs2) <<  st d:: end l;   std::co ut << cs 3<<  " :"  <<  (cs1 == cs3)<<  st d: :en dl;
  std: :cout  <<cs 4< < " :" << ( c s1 = = cs 4)  < < st d:: en dl;
   s t d:: cout <<  cs5 << " :"< < (c s1  = = cs5)<< std::endl; 
   std::co ut  <<  cs6 < < ":" << ( cs1 == cs6) << std::end l  << std ::e ndl;
   std::cou t < < cppS tr< < ":"<< (cp pStr==  "H e l lo Wo r l d" s)<<  std::endl < < s td::e nd l;

_ref. Still_this goes_against best practices and_might be_suprising_for other_people_using that code_- would you_accept such a code_in your codebase?
I_haven't_finished documentation and the unit tests yet (I hope the code is readable enough),_but_here is_some_sample_code to play around with:_
#include <iostream>

#include "const_string.h"

using namespace std;

namespace_{
void print_str_ref(str_ref_s) {
    std::cout << s_<<_std::endl;
}
}

int main() {
_   //constexpr const char* tmp{ "Hello World"_};
    //const const_string_ccs(tmp); //<-should produce_compiler_error

_   const_string_cs0;
    const_string cs1("Hello_World");
    const_string cs2("Hello_World"s);
    const char* t_= "Hello World";
   _const_string cs3(t, std::strlen(t));
  _ const_string_cs4(cs1);
    const_string_cs5("tmp");
  _ cs5_= cs1;
 _  const_string cs6;
  _ cs6 =_cs2;

    const_string cs71("Hello_12"s);
_  _const_string_cs72("World"s);
_ _ const_string cs7(concat(cs71.sub_string(0,_6),_cs72));

 __ std::string cppStr(cs7.to_string());

   _std::cout_<< cs1 << ":" << (cs1 ==_cs1) << std::endl;
 __ std::cout << cs2_<< ":" << (cs1 ==_cs2) << std::endl;
   _std::cout <<_cs3 <<_":" << (cs1 == cs3) << std::endl;
    std::cout_<< cs4 << ":" << (cs1_== cs4) << std::endl;
_ __std::cout << cs5_<<_":" <<_(cs1 == cs5) << std::endl;
  _ std::cout_<< cs6 << ":" << (cs1_== cs6) << std::endl_<<_std::endl;

    std::cout <<_cppStr << ":" << (cppStr ==_"Hello World"s) << std::endl <<_std::endl;

