@@ -450,15 +450,15 @@ class LimitedString
450
450
}
451
451
string.resize (size);
452
452
if (size != 0 )
453
- s.read ((char *)& string[ 0 ] , size);
453
+ s.read ((char *)string. data () , size);
454
454
}
455
455
456
456
template <typename Stream>
457
457
void Serialize (Stream& s) const
458
458
{
459
459
WriteCompactSize (s, string.size ());
460
460
if (!string.empty ())
461
- s.write ((char *)& string[ 0 ] , string.size ());
461
+ s.write ((char *)string. data () , string.size ());
462
462
}
463
463
};
464
464
@@ -556,7 +556,7 @@ void Serialize(Stream& os, const std::basic_string<C>& str)
556
556
{
557
557
WriteCompactSize (os, str.size ());
558
558
if (!str.empty ())
559
- os.write ((char *)& str[ 0 ] , str.size () * sizeof (str[ 0 ] ));
559
+ os.write ((char *)str. data () , str.size () * sizeof (C ));
560
560
}
561
561
562
562
template <typename Stream, typename C>
@@ -565,7 +565,7 @@ void Unserialize(Stream& is, std::basic_string<C>& str)
565
565
unsigned int nSize = ReadCompactSize (is);
566
566
str.resize (nSize);
567
567
if (nSize != 0 )
568
- is.read ((char *)& str[ 0 ] , nSize * sizeof (str[ 0 ] ));
568
+ is.read ((char *)str. data () , nSize * sizeof (C ));
569
569
}
570
570
571
571
@@ -578,7 +578,7 @@ void Serialize_impl(Stream& os, const prevector<N, T>& v, const unsigned char&)
578
578
{
579
579
WriteCompactSize (os, v.size ());
580
580
if (!v.empty ())
581
- os.write ((char *)&v[ 0 ] , v.size () * sizeof (T));
581
+ os.write ((char *)v. data () , v.size () * sizeof (T));
582
582
}
583
583
584
584
template <typename Stream, unsigned int N, typename T, typename V>
@@ -646,7 +646,7 @@ void Serialize_impl(Stream& os, const std::vector<T, A>& v, const unsigned char&
646
646
{
647
647
WriteCompactSize (os, v.size ());
648
648
if (!v.empty ())
649
- os.write ((char *)&v[ 0 ] , v.size () * sizeof (T));
649
+ os.write ((char *)v. data () , v.size () * sizeof (T));
650
650
}
651
651
652
652
template <typename Stream, typename T, typename A, typename V>
0 commit comments